This repository has been archived by the owner on Aug 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 133
/
.travis.yml
91 lines (68 loc) · 2.42 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
89
90
91
dist: bionic
language: php
php:
- '7.4'
- '8.0'
- '8.1'
env:
global:
- COMPOSER_MEMORY_LIMIT=2G
matrix:
- TEST_SUITE=9.5.x
- TEST_SUITE=10.0.x
- TEST_SUITE=PHP_CodeSniffer
# Only run the coding standards check once.
matrix:
exclude:
- php: 7.4
env: TEST_SUITE=PHP_CodeSniffer
- php: 7.4
env: TEST_SUITE=10.0.x
- php: 8.0
env: TEST_SUITE=PHP_CodeSniffer
- php: 8.0
env: TEST_SUITE=10.0.x
mysql:
database: og
username: root
encoding: utf8
services:
- mysql
addons:
chrome: stable
cache:
directories:
- $HOME/.composer/cache/files
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)
# 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
# Update PHPUnit.
- test ${TEST_SUITE} == "PHP_CodeSniffer" || travis_retry composer drupal-phpunit-upgrade --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
# 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
# Start chromedriver for JS tests.
- chromedriver --port=4444 &
script: DRUPAL_DIR=$DRUPAL_DIR MODULE_DIR=$MODULE_DIR $MODULE_DIR/scripts/travis-ci/run-test.sh $TEST_SUITE