forked from fago/rules
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
81 lines (67 loc) · 2.51 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
language: php
# The Travis CI container mode has random functional test fails, so we must use
# sudo here.
sudo: true
php:
- 5.5
- 5.6
- 7
# HHVM is disabled for now because we have not figured out yet how to start a
# web server for the browser tests.
#- hhvm
env:
- DRUPAL_CORE=8.1.x
- DRUPAL_CORE=8.2.x
- DRUPAL_CORE=8.3.x
matrix:
allow_failures:
# We cannot use hhvm-nightly since that does not work in Travis CI's old
# Ubuntu 12.04.
#- php: hhvm
# Don't wait for the allowed failures to build.
fast_finish: true
mysql:
database: rules
username: root
encoding: utf8
# Cache composer downloads because cloning Coder form drupal.org is very slow :-(
cache:
directories:
- $HOME/.composer
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
# Remember the current rules test directory for later use in the Drupal
# installation.
- TESTDIR=$(pwd)
# Navigate out of module directory to prevent blown stack by recursive module
# lookup.
- cd ..
# Create database.
- mysql -e 'create database rules'
# Export database variable for kernel tests.
- export SIMPLETEST_DB=mysql://root:@127.0.0.1/rules
# Download Drupal 8 core from the Github mirror because it is faster.
- travis_retry git clone --branch $DRUPAL_CORE --depth 1 https://github.com/drupal/drupal.git
- cd drupal
# Reference rules in build site.
- ln -s $TESTDIR modules/rules
# Install dependencies.
- travis_retry git clone --branch 8.x-1.x --depth 1 https://github.com/fago/typed_data.git modules/typed_data
# Run composer install for Drupal 8.1 and up. We need an up-to-date composer
# when installing Drupal 8.1.
- travis_retry composer self-update && travis_retry composer install
# Start a web server on port 8888, run in the background.
- php -S localhost:8888 &
# Export web server URL for browser tests.
- export SIMPLETEST_BASE_URL=http://localhost:8888
# Install PHPCS to check for Drupal coding standards.
- travis_retry composer global require drupal/coder
- ~/.composer/vendor/bin/phpcs --config-set installed_paths ~/.composer/vendor/drupal/coder/coder_sniffer
script:
# Run the PHPUnit tests which also include the kernel tests.
- ./vendor/bin/phpunit -c ./core/phpunit.xml.dist ./modules/rules
# Check for coding standards violations
- cd modules/rules && ~/.composer/vendor/bin/phpcs