Merge "objectcache: Make BagOStuff::getCurrentTime() public"
[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 # Use Ubuntu 14 Trusty (not Ubuntu 12 Precise)
12 # <https://docs.travis-ci.com/user/reference/trusty/>
13 # - Required for non-buggy xml library for XmlTypeCheck/UploadBaseTest (T75176).
14 dist: trusty
15
16 # Cache NPM and Composer directories
17 # <https://docs.travis-ci.com/user/caching/>
18 cache:
19 npm: true
20 directories:
21 # Composer doesn't have a dedicated cache setting in Travis CI config, so set the directory path instead.
22 - vendor
23
24 matrix:
25 fast_finish: true
26 include:
27 # On Trusty, mysql user 'travis' doesn't have create database rights
28 # Postgres has no user called 'root'.
29 - env: dbtype=mysql dbuser=root
30 php: 7.3
31 - env: dbtype=mysql dbuser=root
32 php: 7.2
33 - env: dbtype=mysql dbuser=root
34 php: 7.1
35 - env: dbtype=postgres dbuser=travis
36 php: 7.1
37 - env: dbtype=mysql dbuser=root
38 php: 7
39 allow_failures:
40 - php: 7.3
41
42 services:
43 - mysql
44
45 branches:
46 # Test changes in master and arbitrary Travis CI branches only.
47 # The latter allows developers to enable Travis CI in their GitHub fork of
48 # wikimedia/mediawiki and then push changes for testing to branches like
49 # "travis-ci/test-this-awesome-change".
50 only:
51 - master
52 - /^travis-ci\/.*$/
53
54 addons:
55 apt:
56 packages:
57 - djvulibre-bin
58 - tidy
59
60 before_script:
61 - echo 'opcache.enable_cli = 1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
62 - composer install --prefer-source --quiet --no-interaction
63 - if [ "$dbtype" = postgres ]; then psql -c "CREATE DATABASE traviswiki WITH OWNER travis;" -U postgres; fi
64 - >
65 php maintenance/install.php traviswiki admin
66 --pass travis
67 --dbtype "$dbtype"
68 --dbname traviswiki
69 --dbuser "$dbuser"
70 --dbpass ""
71 --scriptpath "/w"
72 - echo -en "\n\nrequire_once __DIR__ . '/includes/DevelopmentSettings.php';\n" >> ./LocalSettings.php
73 - php -l ./LocalSettings.php
74
75 script:
76 - php tests/phpunit/phpunit.php
77
78 notifications:
79 email: false
80 irc:
81 channels:
82 - "chat.freenode.net#wikimedia-dev"
83 template:
84 - "%{repository}#%{build_number} (%{branch} - %{commit} %{author}): %{message} - %{build_url}"
85 on_success: change
86 on_failure: always