Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A build matrix for Travis CI #187

Merged
merged 15 commits into from
Jul 10, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 46 additions & 39 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,33 @@
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
Expand All @@ -14,52 +38,35 @@ install:
before_script:
# Set NODE_PATH for zombie driver.
- export NODE_PATH="`pwd`/node_modules"
# 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
14 changes: 7 additions & 7 deletions behat.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ drupal6:
tags: "@d6"
extensions:
Behat\MinkExtension:
base_url: http://localhost:8886
base_url: http://localhost:8888
Drupal\DrupalExtension:
api_driver: "drupal"
drupal:
# Change this to the absolute path to Drupal install.
drupal_root: "drupal6"
drupal_root: "drupal"
region_map:
left sidebar: "#sidebar-first"
content: "#content"
Expand All @@ -66,12 +66,12 @@ drupal7:
tags: "@d7"
extensions:
Behat\MinkExtension:
base_url: http://localhost:8887
base_url: http://localhost:8888
Drupal\DrupalExtension:
api_driver: "drupal"
drupal:
# Change this to the absolute path to Drupal install.
drupal_root: "drupal7"
drupal_root: "drupal"
region_map:
left sidebar: "#sidebar-first"
content: "#content"
Expand All @@ -91,12 +91,12 @@ drush:
tags: "@drushTest"
extensions:
Behat\MinkExtension:
base_url: http://localhost:8887
base_url: http://localhost:8888
Drupal\DrupalExtension:
api_driver: "drush"
drush_driver: "drush"
drush:
root: "drupal7"
root: "drupal"
region_map:
left sidebar: "#sidebar-first"
content: "#content"
Expand All @@ -119,7 +119,7 @@ drupal8:
api_driver: "drupal"
drupal:
# Change this to the absolute path to Drupal install.
drupal_root: "drupal8"
drupal_root: "drupal"
region_map:
left sidebar: "#sidebar-first"
content: "#content"