1 # Travis CI build configuration for MediaWiki
2 # <https://travis-ci.org/wikimedia/mediawiki-core>
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
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).
16 # Cache NPM and Composer directories
17 # <https://docs.travis-ci.com/user/caching/>
21 # Composer doesn't have a dedicated cache setting in Travis CI config, so set the directory path instead.
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
31 - env: dbtype=mysql dbuser=root
33 - env: dbtype=mysql dbuser=root
35 - env: dbtype=postgres dbuser=travis
37 - env: dbtype=mysql dbuser=root
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".
61 - composer install --prefer-source --quiet --no-interaction
62 - if [ "$dbtype" = postgres ]; then psql -c "CREATE DATABASE traviswiki WITH OWNER travis;" -U postgres; fi
64 php maintenance/install.php traviswiki admin
71 - echo -en "\n\nrequire_once __DIR__ . '/includes/DevelopmentSettings.php';\n" >> ./LocalSettings.php
72 - php -l ./LocalSettings.php
75 - php tests/phpunit/phpunit.php
81 - "chat.freenode.net#wikimedia-dev"
83 - "%{repository}#%{build_number} (%{branch} - %{commit} %{author}): %{message} - %{build_url}"