|
| 1 | +# PHP CircleCI 2.0 configuration file |
| 2 | +# |
| 3 | +# Check https://circleci.com/docs/2.0/language-php/ for more details |
| 4 | +version: 2.1 |
| 5 | + |
| 6 | +jobs: |
| 7 | + # Test that coding standards fit drupal.org definitions. |
| 8 | + coding_standards: |
| 9 | + docker: |
| 10 | + - image: circleci/php:8.0-apache-browsers |
| 11 | + steps: |
| 12 | + - checkout |
| 13 | + - run: |
| 14 | + name: Fetch phpcs and dependencies |
| 15 | + command: | |
| 16 | + composer require drupal/coder --prefer-stable --no-interaction --optimize-autoloader |
| 17 | + composer require slevomat/coding-standard --prefer-stable --no-interaction --optimize-autoloader |
| 18 | + # Move vendor directory up a level as we don't want to code-check all of that. |
| 19 | + mv vendor ../ |
| 20 | + - run: |
| 21 | + name: Fetch phpcs convenience script |
| 22 | + command: | |
| 23 | + curl https://raw.githubusercontent.com/dof-dss/nidirect-drupal/development/phpcs.sh -o /home/circleci/project/phpcs.sh |
| 24 | + chmod +x /home/circleci/project/phpcs.sh |
| 25 | + - run: |
| 26 | + name: PHPCS analysis |
| 27 | + command: /home/circleci/project/phpcs.sh /home/circleci "/home/circleci/project" |
| 28 | + |
| 29 | + deprecated_code: |
| 30 | + docker: |
| 31 | + - image: circleci/php:8.0-apache-browsers |
| 32 | + steps: |
| 33 | + - checkout: |
| 34 | + path: /home/circleci/origins_modules |
| 35 | + - run: |
| 36 | + name: Add OS and PHP extensions/config |
| 37 | + command: | |
| 38 | + sudo cp /home/circleci/origins_modules/.circleci/docker-php-circleci.ini /usr/local/etc/php/conf.d/ |
| 39 | + sudo apt --allow-releaseinfo-change update |
| 40 | + sudo apt install -y libpng-dev |
| 41 | + sudo docker-php-ext-install gd |
| 42 | + - run: |
| 43 | + name: Fetch latest Drupal version |
| 44 | + command: | |
| 45 | + cd /home/circleci |
| 46 | + composer create-project drupal-composer/drupal-project:9.x-dev /home/circleci/project --no-interaction |
| 47 | + - run: |
| 48 | + name: Download dependent contrib modules. |
| 49 | + command: | |
| 50 | + cd /home/circleci/project |
| 51 | + composer require drupal/entity_embed mglaman/drupal-check:1.3.0 composer/xdebug-handler:2.0.1 --no-interaction |
| 52 | + - run: |
| 53 | + name: Move custom code into position |
| 54 | + command: mv /home/circleci/origins_modules /home/circleci/project/web/modules/origins |
| 55 | + - run: |
| 56 | + name: Deprecated code check |
| 57 | + command: | |
| 58 | + cd /home/circleci/project/web |
| 59 | + ../vendor/bin/drupal-check modules/origins -e "*/tests/*" |
| 60 | +
|
| 61 | +workflows: |
| 62 | + version: 2 |
| 63 | + static_analysis: |
| 64 | + jobs: |
| 65 | + - coding_standards |
| 66 | + - deprecated_code |
0 commit comments