-
-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #187 from pfrenssen/travis-build-matrix
A build matrix for Travis CI Signed-off-by: Jonathan Hedstrom <jhedstrom@gmail.com>
- Loading branch information
Showing
2 changed files
with
53 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,69 @@ | ||
language: php | ||
|
||
php: [5.5, 5.4] | ||
php: | ||
- 5.4 | ||
- 5.5 | ||
- 5.6 | ||
- 7.0 | ||
|
||
env: | ||
- PATH=$PATH:/home/travis/.composer/vendor/bin | ||
global: | ||
- PATH=$PATH:/home/travis/.composer/vendor/bin | ||
matrix: | ||
- DRUPAL_VERSION=6 | ||
- DRUPAL_VERSION=7 | ||
- DRUPAL_VERSION=8 | ||
|
||
matrix: | ||
exclude: | ||
- php: 5.3 | ||
env: DRUPAL_VERSION=8 | ||
- php: 5.4 | ||
env: DRUPAL_VERSION=8 | ||
- php: 5.6 | ||
env: DRUPAL_VERSION=6 | ||
- php: 7.0 | ||
env: DRUPAL_VERSION=6 | ||
- php: hhvm | ||
env: DRUPAL_VERSION=6 | ||
allow_failures: | ||
- php: 7.0 | ||
|
||
install: | ||
- composer self-update | ||
- composer install | ||
- composer global require drush/drush:dev-master --prefer-source | ||
|
||
before_script: | ||
# Define the module path according to the Drupal version being tested. | ||
- test ${DRUPAL_VERSION} -eq 8 && export MODULE_PATH='drupal/modules' || export MODULE_PATH='drupal/sites/all/modules' | ||
# Drupal 8 uses semantic versioning. | ||
- test ${DRUPAL_VERSION} -eq 8 && export PROJECT_NAME='drupal-8.0.x' || export PROJECT_NAME="drupal-${DRUPAL_VERSION}.x" | ||
# Set sendmail so drush doesn't throw an error during site install. | ||
- echo "sendmail_path='true'" >> `php --ini | grep "Loaded Configuration" | awk '{print $4}'` | ||
# Setup a stack Drupal 6 install to test api abilities. | ||
- mysql -e 'create database drupal6' | ||
- drush --quiet dl drupal-6 --drupal-project-rename=drupal6 | ||
- drush --yes --root=$PWD/drupal6 site-install --db-url=mysql://travis:@127.0.0.1/drupal6 | ||
- cp -r fixtures/drupal6/modules/behat_test drupal6/sites/all/modules | ||
- cd drupal6 | ||
- drush --yes en behat_test | ||
# - drush --yes fr behat_test | ||
- drush cc all | ||
- drush --debug runserver :8886 > ~/debug6.txt 2>&1 & | ||
- cd - | ||
# Setup a stock Drupal 7 install to test api abilities. | ||
- mysql -e 'create database drupal7' | ||
- drush --quiet dl drupal-7 --drupal-project-rename=drupal7 | ||
- drush --yes --root=$PWD/drupal7 site-install --db-url=mysql://travis:@127.0.0.1/drupal7 | ||
- cp -r fixtures/drupal7/modules/behat_test drupal7/sites/all/modules | ||
- cd drupal7 | ||
- drush --yes en behat_test | ||
- drush --yes fr behat_test | ||
- drush cc all | ||
- drush --debug runserver :8887 > ~/debug7.txt 2>&1 & | ||
- cd - | ||
# Setup a stock Drupal 8 install to test api abilities. | ||
- mysql -e 'create database drupal8' | ||
- (cd drupal8 && git pull && cd -) || git clone --branch 8.0.x http://git.drupal.org/project/drupal.git drupal8 | ||
- drush --yes --root=$PWD/drupal8 site-install --db-url=mysql://travis:@127.0.0.1/drupal8 | ||
- cp -r fixtures/drupal8/modules/behat_test drupal8/modules | ||
- cd drupal8 | ||
- mysql -e 'create database drupal' | ||
- drush --quiet dl ${PROJECT_NAME} --dev --all --drupal-project-rename=drupal | ||
- drush --yes --root=$PWD/drupal site-install --db-url=mysql://travis:@127.0.0.1/drupal | ||
- cp -r fixtures/drupal${DRUPAL_VERSION}/modules/behat_test ${MODULE_PATH} | ||
- cd drupal | ||
- drush --yes en behat_test | ||
- drush --yes pmu page_cache | ||
- drush cr | ||
- drush runserver :8888 > ~/debug8.txt 2>&1 & | ||
# Only revert features on Drupal 7. | ||
- test ${DRUPAL_VERSION} -eq 7 && drush --yes fr behat_test || true | ||
# Disable the page cache on Drupal 8. | ||
- test ${DRUPAL_VERSION} -eq 8 && drush --yes pmu page_cache || true | ||
# Clear the cache on Drupal 6 and 7, rebuild on Drupal 8. | ||
- test ${DRUPAL_VERSION} -eq 8 && drush cr || drush cc all || true | ||
- drush --debug runserver :8888 > ~/debug.txt 2>&1 & | ||
- cd - | ||
- sleep 4s | ||
|
||
script: | ||
- vendor/bin/phpspec run -f pretty --no-interaction | ||
- vendor/bin/behat -fprogress --strict | ||
- vendor/bin/behat -fprogress --profile=drupal6 --strict | ||
- vendor/bin/behat -fprogress --profile=drupal7 --strict | ||
- vendor/bin/behat -fprogress --profile=drush --strict | ||
- vendor/bin/behat -fprogress --profile=drupal8 --strict | ||
- vendor/bin/behat -fprogress --profile=drupal${DRUPAL_VERSION} --strict | ||
# Only test the Drush profile if Drupal 7 was installed. | ||
- test ${DRUPAL_VERSION} -eq 7 && vendor/bin/behat -fprogress --profile=drush --strict || true | ||
|
||
after_failure: | ||
- cat ~/debug6.txt | ||
- cat ~/debug7.txt | ||
- cat ~/debug8.txt | ||
- cat ~/debug.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters