forked from jhedstrom/drupalextension
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
88 lines (80 loc) · 3.38 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
language: php
php:
- 5.3
- 5.4
- 5.5
- 5.6
- 7.0
env:
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
allow_failures:
- php: 7.0
env: DRUPAL_VERSION=7
- php: 5.3
# Enable Travis containers.
sudo: false
install:
- composer self-update
# Use the example composer.json file for Drupal 8, and also install the behat drush endpoint.
- test ${DRUPAL_VERSION} -ne 8 || (cp doc/_static/composer.json.d8 ./composer.json && composer require --prefer-source drush-ops/behat-drush-endpoint drupal/drupal-driver:dev-master)
- composer install
# Drush version must vary depending on environment and version of core.
- test ${TRAVIS_PHP_VERSION} == "5.3" && composer global require drush/drush:~6.0 || composer global require drush/drush:~8.0
# Install the Behat Drush Endpoint for Drupal 7 tests.
- test ${DRUPAL_VERSION} -ne 7 || (git clone https://github.com/drush-ops/behat-drush-endpoint.git drush/behat-drush-endpoint && (cd drush/behat-drush-endpoint && composer install))
# PHP 5.3 requires the cgi extension for runserver.
- test \! ${TRAVIS_PHP_VERSION} == "5.3" || pecl install cgi
- npm 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.1.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 drupal'
- drush --quiet dl ${PROJECT_NAME} --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 cc drush
- test ${DRUPAL_VERSION} -eq 6 || drush help behat
# Only revert features on Drupal 7.
- test \! ${DRUPAL_VERSION} -eq 7 || drush --yes fr behat_test
# Disable the page cache on Drupal 8.
- test \! ${DRUPAL_VERSION} -eq 8 || drush --yes pmu page_cache
# Test with big_pipe enabled for Drupal 8.
- test \! ${DRUPAL_VERSION} -eq 8 || drush --yes en -y big_pipe
# 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:
- find ./src -name "*.php" -print0 | xargs -0 -n1 -P8 php -l
- vendor/bin/phpspec run -f pretty --no-interaction
- vendor/bin/behat -fprogress --strict
- vendor/bin/behat -fprogress --profile=drupal${DRUPAL_VERSION} --strict
# Do not test the Drush profile unless Drupal 7 was installed.
- test ${DRUPAL_VERSION} -ne 7 || vendor/bin/behat -fprogress --profile=drush --strict
after_failure:
- cat ~/debug.txt