2014-12-11 11:42:36 +01:00
|
|
|
language: php
|
2013-10-10 00:24:17 +02:00
|
|
|
|
2015-07-20 16:59:29 +02:00
|
|
|
sudo: false
|
|
|
|
|
2017-09-03 20:49:34 +02:00
|
|
|
dist: precise
|
|
|
|
|
2015-07-20 16:59:29 +02:00
|
|
|
addons:
|
|
|
|
apt:
|
|
|
|
packages:
|
|
|
|
- tidy
|
|
|
|
|
2016-01-20 20:37:43 +01:00
|
|
|
before_install:
|
|
|
|
- pip install --user codecov
|
|
|
|
|
2013-10-10 00:38:08 +02:00
|
|
|
env:
|
2014-12-11 11:42:36 +01:00
|
|
|
global:
|
|
|
|
- DB=MYSQL CORE_RELEASE=3.1
|
2013-10-10 00:24:17 +02:00
|
|
|
|
2016-01-20 20:37:43 +01:00
|
|
|
# Turn coverage off by default, as it's expensive time wise
|
|
|
|
- COVERAGE=0
|
|
|
|
|
|
|
|
# The path of the module when installed by composer
|
|
|
|
- MODULE_PATH=blog
|
|
|
|
|
2013-10-10 00:38:08 +02:00
|
|
|
matrix:
|
|
|
|
include:
|
2014-12-11 11:42:36 +01:00
|
|
|
- php: 5.6
|
2016-01-20 20:37:43 +01:00
|
|
|
env: DB=MYSQL COVERAGE=1
|
2014-12-11 11:42:36 +01:00
|
|
|
- php: 5.5
|
|
|
|
env: DB=MYSQL
|
2016-01-21 17:46:10 +01:00
|
|
|
- php: 5.6
|
|
|
|
env: DB=PGSQL
|
|
|
|
- php: 5.6
|
|
|
|
env: DB=MYSQL CORE_RELEASE=3.2
|
|
|
|
- php: 5.6
|
|
|
|
env: DB=PGSQL CORE_RELEASE=3.2
|
2013-10-10 00:38:08 +02:00
|
|
|
- php: 5.4
|
2016-01-24 23:57:26 +01:00
|
|
|
env: DB=SQLITE
|
2014-12-11 11:42:36 +01:00
|
|
|
- php: 5.3
|
|
|
|
env: DB=MYSQL
|
2017-06-14 23:58:30 +02:00
|
|
|
- php: 7.1
|
|
|
|
env: DB=MYSQL CORE_RELEASE=3.6
|
2014-12-11 11:42:36 +01:00
|
|
|
|
2013-10-10 00:24:17 +02:00
|
|
|
|
2013-10-10 00:38:08 +02:00
|
|
|
before_script:
|
|
|
|
- phpenv rehash
|
2015-06-15 11:01:44 +02:00
|
|
|
- composer self-update || true
|
2017-06-14 23:58:30 +02:00
|
|
|
- git clone git://github.com/silverstripe/silverstripe-travis-support.git ~/travis-support
|
2015-05-19 02:35:35 +02:00
|
|
|
- php ~/travis-support/travis_setup.php --source `pwd` --target ~/builds/ss --require "silverstripe/comments" --require "silverstripe/widgets"
|
2013-10-10 01:22:12 +02:00
|
|
|
- cd ~/builds/ss
|
2013-10-10 00:38:08 +02:00
|
|
|
|
2016-01-20 20:37:43 +01:00
|
|
|
#Execute tests with or without coverage
|
2014-12-11 11:42:36 +01:00
|
|
|
script:
|
2016-01-20 20:37:43 +01:00
|
|
|
# Execute tests with no coverage. This is the fastest option
|
|
|
|
- "if [ \"$COVERAGE\" = \"0\" ]; then vendor/bin/phpunit $MODULE_PATH/tests/; fi"
|
|
|
|
|
|
|
|
# Execute tests with coverage. Do this for a small
|
|
|
|
- "if [ \"$COVERAGE\" = \"1\" ]; then vendor/bin/phpunit --coverage-clover=coverage.clover $MODULE_PATH/tests/; fi"
|
|
|
|
|
|
|
|
#Upload coverage even if there is a failure
|
|
|
|
after_script:
|
|
|
|
- "if [ \"$COVERAGE\" = \"1\" ]; then mv coverage.clover ~/build/$TRAVIS_REPO_SLUG/; fi"
|
|
|
|
- cd ~/build/$TRAVIS_REPO_SLUG
|
|
|
|
- wget https://scrutinizer-ci.com/ocular.phar
|
|
|
|
- "if [ \"$COVERAGE\" = \"1\" ]; then travis_retry codecov && travis_retry php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi"
|