-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
85 lines (65 loc) · 2.64 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
language: php
sudo: true
php:
- 5.6
- 7.0
- 7.1
- 7.2
env:
global:
- COMPOSER_MEMORY_LIMIT=2G
matrix:
- TEST_SUITE=8.5.x
- TEST_SUITE=8.6.x
- TEST_SUITE=PHP_CodeSniffer
# Only run the coding standards check once.
matrix:
exclude:
- php: 5.6
env: TEST_SUITE=PHP_CodeSniffer
- php: 7.0
env: TEST_SUITE=PHP_CodeSniffer
- php: 7.1
env: TEST_SUITE=PHP_CodeSniffer
allow_failures:
- env: TEST_SUITE=8.6.x
mysql:
database: og
username: root
encoding: utf8
before_script:
# Remove Xdebug as we don't need it and it causes "PHP Fatal error: Maximum
# function nesting level of '256' reached."
# We also don't care if that file exists or not on PHP 7.
- phpenv config-rm xdebug.ini || true
# Make sure Composer is up to date.
- composer self-update
# Remember the current directory for later use in the Drupal installation.
- MODULE_DIR=$(pwd)
# Install Composer dependencies for OG.
- composer install
# Navigate out of module directory to prevent blown stack by recursive module
# lookup.
- cd ..
# Create database.
- mysql -e 'create database og'
# Download Drupal 8 core. Skip this for the coding standards test.
- test ${TEST_SUITE} == "PHP_CodeSniffer" || travis_retry git clone --branch $TEST_SUITE --depth 1 https://git.drupal.org/project/drupal.git
# Remember the Drupal installation path.
- DRUPAL_DIR=$(pwd)/drupal
# Download Drupal console so we can run the test for it. Skip this for the
# coding standards test.
- test ${TEST_SUITE} == "PHP_CodeSniffer" || composer require --dev drupal/console:~1.0 --working-dir=$DRUPAL_DIR
# Install Composer dependencies for core. Skip this for the coding standards test.
- test ${TEST_SUITE} == "PHP_CodeSniffer" || composer install --working-dir=$DRUPAL_DIR
# PHPUnit 6 is required when running tests on PHP 7.x.
- test ${TEST_SUITE} == "PHP_CodeSniffer" || test ${TRAVIS_PHP_VERSION:0:3} == "5.6" || composer require --dev phpunit/phpunit:~6 --update-with-dependencies --working-dir=$DRUPAL_DIR
# Start a web server on port 8888 in the background.
- test ${TEST_SUITE} == "PHP_CodeSniffer" || nohup php -S localhost:8888 --docroot $DRUPAL_DIR > /dev/null 2>&1 &
# Wait until the web server is responding.
- test ${TEST_SUITE} == "PHP_CodeSniffer" || until curl -s localhost:8888; do true; done > /dev/null
# Export web server URL for browser tests.
- export SIMPLETEST_BASE_URL=http://localhost:8888
# Export database variable for kernel tests.
- export SIMPLETEST_DB=mysql://root:@127.0.0.1/og
script: DRUPAL_DIR=$DRUPAL_DIR MODULE_DIR=$MODULE_DIR $MODULE_DIR/scripts/travis-ci/run-test.sh $TEST_SUITE