forked from Gizra/message
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
68 lines (50 loc) · 2 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
language: php
sudo: false
php:
- 5.6
- 7.0
env:
- TEST_SUITE=8.1.x
- TEST_SUITE=8.2.x
- TEST_SUITE=8.3.x
- TEST_SUITE=PHP_CodeSniffer
# Only run the coding standards check once.
matrix:
exclude:
- php: 5.6
env: TEST_SUITE=PHP_CodeSniffer
mysql:
database: drupal
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.
- composer install
# Navigate out of module directory to prevent blown stack by recursive module
# lookup.
- cd ..
# Create database.
- mysql -e 'create database drupal'
# 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
# Install Composer dependencies for core. Skip this for the coding standards test.
- test ${TEST_SUITE} == "PHP_CodeSniffer" || composer install --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/drupal
script: DRUPAL_DIR=$DRUPAL_DIR MODULE_DIR=$MODULE_DIR $MODULE_DIR/scripts/travis-ci/run-test.sh $TEST_SUITE