wiki.techinc.nl/.travis.yml
Timo Tijhof ba9ba95fb0 build: Remove git-depth:3 from Travis CI config
Follows-up 236b7ae849.

The git-clone protocol does not support checking out a specific
commit directly. It requires that you clone first from a specific
branch (with an optional specified limited depth) and then you
can checkout a commit.

Limiting the depth means that the Travis CI build fails if when
the build starts at a time where there are at least N commits
in master after the one being tested.

This can happen if more than 3 commits merge within 15 minutes
of time (which is how long our Travis build takes roughly).
While that might seem unlikely given our Jenkins build take
about the same amount of time, our Zuul is able to anticipate
ahead of a merge and actually test many commits at once and then
once they all pass, merge them all at once.

Aside from that, one can also click "Restart" as repo admin in
Travis, which always fails for a past build basically.

Change-Id: I2a46821d6d78e637f03de0c4aa25a3488253ff1a
2019-03-21 00:33:39 +00:00

85 lines
2.4 KiB
YAML

# Travis CI build configuration for MediaWiki
# <https://travis-ci.org/wikimedia/mediawiki-core>
#
# The Wikimedia Foundation uses a self-hosted Jenkins instance to run unit
# tests, but it tests code against the version of PHP that is deployed on
# Wikimedia's production cluster. This Travis CI configuration is designed to
# complement that setup by testing MediaWiki on travis
#
language: php
# Use Ubuntu 14 Trusty (not Ubuntu 12 Precise)
# <https://docs.travis-ci.com/user/reference/trusty/>
# - Required for non-buggy xml library for XmlTypeCheck/UploadBaseTest (T75176).
dist: trusty
# Cache NPM and Composer directories
# <https://docs.travis-ci.com/user/caching/>
cache:
npm: true
directories:
# Composer doesn't have a dedicated cache setting in Travis CI config, so set the directory path instead.
- vendor
matrix:
fast_finish: true
include:
# On Trusty, mysql user 'travis' doesn't have create database rights
# Postgres has no user called 'root'.
- env: dbtype=mysql dbuser=root
php: 7.3
- env: dbtype=mysql dbuser=root
php: 7.2
- env: dbtype=mysql dbuser=root
php: 7.1
- env: dbtype=postgres dbuser=travis
php: 7.1
- env: dbtype=mysql dbuser=root
php: 7
allow_failures:
- php: 7.3
services:
- mysql
branches:
# Test changes in master and arbitrary Travis CI branches only.
# The latter allows developers to enable Travis CI in their GitHub fork of
# wikimedia/mediawiki and then push changes for testing to branches like
# "travis-ci/test-this-awesome-change".
only:
- master
- /^travis-ci\/.*$/
addons:
apt:
packages:
- djvulibre-bin
- tidy
before_script:
- composer install --prefer-source --quiet --no-interaction
- if [ "$dbtype" = postgres ]; then psql -c "CREATE DATABASE traviswiki WITH OWNER travis;" -U postgres; fi
- >
php maintenance/install.php traviswiki admin
--pass travis
--dbtype "$dbtype"
--dbname traviswiki
--dbuser "$dbuser"
--dbpass ""
--scriptpath "/w"
- echo -en "\n\nrequire_once __DIR__ . '/includes/DevelopmentSettings.php';\n" >> ./LocalSettings.php
- php -l ./LocalSettings.php
script:
- php tests/phpunit/phpunit.php
notifications:
email: false
irc:
channels:
- "chat.freenode.net#wikimedia-dev"
template:
- "%{repository}#%{build_number} (%{branch} - %{commit} %{author}): %{message} - %{build_url}"
on_success: change
on_failure: always