-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
55 lines (49 loc) · 2.16 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
# Configuration file for running the test suite. Results typically at http://travis-ci.org/backdrop/backdrop
language: php
sudo: required
dist: precise
group: legacy
php:
- 5.3
- 7.0
# Split the execution of our tests into 4 separate builds.
env:
- RUNSPLIT=1/3
- RUNSPLIT=2/3
- RUNSPLIT=3/3
before_script:
# Install Apache and FastCGI extension to connect to PHP-FPM.
- sudo apt-get update > /dev/null
- sudo apt-get install apache2 libapache2-mod-fastcgi > /dev/null
- sudo a2enmod rewrite actions fastcgi alias
- sudo cp -f core/misc/travis-ci/vhost.conf /etc/apache2/sites-available/default
- sudo sed -i -e "s,/var/www,`pwd`,g" /etc/apache2/sites-available/default
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "5.3" ]]; then sh core/misc/travis-ci/install-xcache.sh; fi
- sudo apachectl restart
# Start PHP-FPM. There is no process manager available to start PHP-FPM on
# Travis CI currently, so we have to locate and enable it manually.
- sudo cp core/misc/travis-ci/php-fpm.conf $HOME/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf
- $HOME/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm
# Disable XDebug to speed up execution.
- phpenv config-rm xdebug.ini
# Import the PHP configuration.
- phpenv config-add core/misc/travis-ci/php.ini
# Create a RAM disk for MySQL to improve performance.
- sudo mkdir /mnt/ramdisk
- sudo mount -t tmpfs -o size=1024m tmpfs /mnt/ramdisk
- sudo stop mysql
- sudo mv /var/lib/mysql /mnt/ramdisk
- sudo ln -s /mnt/ramdisk/mysql /var/lib/mysql
- sudo start mysql
# Set MySQL configuration and create the database.
- mysql -e 'SET GLOBAL wait_timeout = 5400;'
- mysql -e 'create database backdrop;'
# Install Backdrop with the installation script.
- chmod a+w . settings.php
- ./core/scripts/install.sh --db-url=mysql://travis:@127.0.0.1/backdrop
- chmod go-w . settings.php
script: php -d display_errors="stderr" ./core/scripts/run-tests.sh --split=$RUNSPLIT --concurrency 2 --url http://localhost --color --verbose --force --all --cache
after_failure:
- echo "Failures detected. Outputing additional logs:"
- sudo cat /var/log/apache2/error.log
- sudo cat /var/log/mysql/error.log