forked from pfrenssen/vrt-testing-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
57 lines (42 loc) · 1.31 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
language: php
php:
- 5.6
- 7.0
sudo: false
mysql:
database: myproject
username: root
encoding: utf8
env:
- TEST=PHP_CodeSniffer
- TEST=PHPUnit
- TEST=Behat
matrix:
exclude:
- php: 5.6
env: TEST=PHP_CodeSniffer
before_install:
# Remove Xdebug as we don't need it and it causes "PHP Fatal error: Maximum
# function nesting level of '256' reached". We don't care if that file exists
# or not on PHP 7.
- phpenv config-rm xdebug.ini || true
# Update composer.
- composer --verbose self-update
# Create database.
- mysql -e 'create database myproject'
install:
# Install Composer dependencies.
- composer --verbose install
# Define build properties for the local test environment.
- echo -e "drupal.base_url = http://localhost:8888\n" > build.properties.local
# Build the project.
- ./vendor/bin/phing build-dev
# Install Drupal. This is not needed when doing a coding standards check.
- test ${TEST} == "PHP_CodeSniffer" || ./vendor/bin/phing install-dev
# Start a web server on port 8888 in the background.
- cd $TRAVIS_BUILD_DIR/web
- nohup php -S localhost:8888 > /dev/null 2>&1 &
# Wait until the web server is responding.
- until curl -s localhost:8888; do true; done > /dev/null
- cd $TRAVIS_BUILD_DIR
script: ./scripts/travis-ci/run-test.sh ${TEST}