Skip to content

Commit

Permalink
Add CI steps for drupal/drupal and drupal-project (#54)
Browse files Browse the repository at this point in the history
* Add steps for drupal/drupal and drupal-project

* Add tests against a core module for autoloading

* Expand the module checks

* Ensure GD and tag for @Alpha

* Action has deprecations until 8.7.0

* Upgrade phpstan-drupal

* Add some verbosity

* Tests do not analyze due to missing dev dependencies...

* This passes locall
  • Loading branch information
mglaman authored May 3, 2019
1 parent 8a6be43 commit f0ed61e
Showing 1 changed file with 75 additions and 19 deletions.
94 changes: 75 additions & 19 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ aliases:
- &composer-cache
v4-composer-cache
commands:
start-project:
setup-job:
steps:
- checkout
- run: sudo apt-get update && sudo apt-get install -y libpng-dev libjpeg62-turbo-dev
- run: sudo docker-php-ext-install gd
- restore_cache:
keys:
- *composer-cache
Expand All @@ -21,6 +23,7 @@ commands:
key: *composer-cache
paths:
- ~/.composer/cache

build-phar:
steps:
- run: echo "Downloading box.phar version $BOX_VERSION"
Expand All @@ -32,13 +35,9 @@ commands:
type: string
default: 'drupal-composer/drupal-project:8.x-dev'
steps:
- run: composer create-project << parameters.project >> /tmp/drupal --no-interaction --no-dev --prefer-dist --ignore-platform-reqs
- run: composer create-project << parameters.project >> /tmp/drupal --no-interaction --prefer-dist --ignore-platform-reqs
global-require:
steps:
- run:
name: Remove vendor directory
command: |
rm -rf vendor
- run:
name: Add project as a global dependency
command: |
Expand All @@ -60,7 +59,7 @@ jobs:
lint:
<<: *defaults
steps:
- start-project
- setup-job
- run:
name: Composer Validate
command: |
Expand All @@ -72,34 +71,86 @@ jobs:
build:
<<: *defaults
steps:
- start-project
- setup-job
- build-phar
- run: php box.phar info drupal-check.phar
test_lightning:
test_drupal:
<<: *defaults
steps:
- start-project
- setup-job
- build-phar
- create-drupal-project:
project: 'acquia/lightning-project'
project: 'drupal/drupal:^8@alpha'
- run:
name: Run against a file
name: Phar - Run against a file
command: |
php drupal-check.phar /tmp/drupal/docroot/core/install.php
test_global_require:
php drupal-check.phar /tmp/drupal/core/install.php -vvv
- run:
name: Phar - Run against a module
command: |
php drupal-check.phar /tmp/drupal/core/modules/dynamic_page_cache -vvv
- global-require
- run:
name: Global - Run against a file
command: |
drupal-check /tmp/drupal/core/install.php
- run:
name: Global - Run against a module
command: |
drupal-check /tmp/drupal/core/modules/dynamic_page_cache
test_drupal_project:
<<: *defaults
steps:
- start-project
- global-require
- setup-job
- build-phar
- create-drupal-project
- run:
name: Run against a file
name: Phar - Run against a file
command: |
php drupal-check.phar /tmp/drupal/web/core/install.php
- run:
name: Phar - Run against a module
command: |
php drupal-check.phar /tmp/drupal/web/core/modules/dynamic_page_cache
- global-require
- run:
name: Global - Run against a file
command: |
drupal-check /tmp/drupal/web/core/install.php
- run:
name: Global - Run against a module
command: |
drupal-check /tmp/drupal/web/core/modules/dynamic_page_cache
test_lightning:
<<: *defaults
steps:
- setup-job
- build-phar
# acquia/lightning-project does not require-dev Drupal's require-dev.
# see PR https://github.com/acquia/lightning-project/pull/101
- create-drupal-project:
project: 'acquia/lightning-project'
- run:
name: Phar - Run against a file
command: |
php drupal-check.phar /tmp/drupal/docroot/core/install.php
# - run:
# name: Phar - Run against a module
# command: |
# php drupal-check.phar /tmp/drupal/docroot/core/modules/dynamic_page_cache
- global-require
- run:
name: Global - Run against a file
command: |
drupal-check /tmp/drupal/docroot/core/install.php
# - run:
# name: Global - Run against a module
# command: |
# drupal-check /tmp/drupal/docroot/core/modules/dynamic_page_cache
test_global_require_with_drush:
<<: *defaults
steps:
- start-project
- setup-job
- run:
name: Install Drush globally (which is not recommended by Drush team)
command: |
Expand All @@ -110,13 +161,18 @@ jobs:
name: Run against a file
command: |
drupal-check /tmp/drupal/web/core/install.php
- run:
name: Run against a module
command: |
drupal-check /tmp/drupal/web/core/modules/dynamic_page_cache
workflows:
version: 2
test_and_deploy:
jobs:
- lint
- test_drupal
- test_drupal_project
- test_lightning
- test_global_require
- test_global_require_with_drush
- build

0 comments on commit f0ed61e

Please sign in to comment.