Make travis test php 5.3, 5.4 and 5.5
[lhc/web/wiklou.git] / .travis.yml
1 # Travis CI build configuration for MediaWiki
2 # <https://travis-ci.org/wikimedia/mediawiki-core>
3 #
4 # The Wikimedia Foundation uses a self-hosted Jenkins instance to run unit
5 # tests, but it tests code against the version of PHP that is deployed on
6 # Wikimedia's production cluster. This Travis CI configuration is designed to
7 # complement that setup by testing MediaWiki on travis
8 #
9 language: php
10
11 php:
12 - hhvm
13 - 5.3
14 - 5.4
15 - 5.5
16
17 matrix:
18 allow_failures:
19 - php: 5.3
20 - php: 5.4
21 - php: 5.5
22
23 services:
24 - mysql
25
26 branches:
27 # Test changes in master and in Wikimedia's production branches.
28 only:
29 - master
30 - /^wmf\/.*$/
31
32 before_install:
33 - sudo apt-get install -qq djvulibre-bin tidy
34
35 before_script:
36 # Initialise submodules, in case we're testing a Wikimedia production branch.
37 - git submodule update --init --recursive
38 # Travis CI's HHVM environment provides PHPUnit as a phar file, but
39 # MediaWiki's test suite only works if individual PHPUnit files are
40 # actual files on disk (bug 58881).
41 - composer require 'phpunit/phpunit=3.7.*' --prefer-source
42 - >
43 php maintenance/install.php testwiki admin
44 --pass travis
45 --dbname traviswiki
46 --dbuser travis
47 --dbpass ""
48 --scriptpath "/w"
49
50 script:
51 - >
52 if [ "$TRAVIS_PHP_VERSION" = "hhvm" ];
53 then
54 hhvm --php \
55 -d include_path=".$(printf ':%s' vendor/phpunit/*)" \
56 -d date.timezone="Etc/UTC" \
57 tests/phpunit/phpunit.php
58 else
59 php tests/phpunit/phpunit.php \
60 --with-phpunitdir ./vendor/phpunit/phpunit
61 fi