2016-01-07 07:59:10 +01:00
|
|
|
language: php
|
2013-03-29 09:33:51 +01:00
|
|
|
|
2016-01-07 07:59:10 +01:00
|
|
|
sudo: true
|
2015-07-20 17:02:57 +02:00
|
|
|
|
2016-01-07 07:59:10 +01:00
|
|
|
addons:
|
|
|
|
apt:
|
|
|
|
packages:
|
|
|
|
- tidy
|
2015-11-19 02:18:53 +01:00
|
|
|
|
|
|
|
php:
|
|
|
|
- 5.5
|
|
|
|
- 5.6
|
|
|
|
- 7.0
|
2017-01-16 06:10:05 +01:00
|
|
|
- 7.1
|
2015-11-19 02:18:53 +01:00
|
|
|
|
2016-01-07 07:59:10 +01:00
|
|
|
before_install:
|
|
|
|
- pip install --user codecov
|
|
|
|
|
2013-03-29 09:33:51 +01:00
|
|
|
env:
|
2016-01-07 07:59:10 +01:00
|
|
|
global:
|
2017-01-17 05:33:39 +01:00
|
|
|
- DB=MYSQL CORE_RELEASE=master
|
2016-01-07 07:59:10 +01:00
|
|
|
- MODULE_PATH=comments
|
|
|
|
|
|
|
|
# Set to 1 in the matrix to enable code coverage
|
|
|
|
- COVERAGE=0
|
2013-03-29 09:33:51 +01:00
|
|
|
|
|
|
|
matrix:
|
|
|
|
include:
|
2016-01-07 07:59:10 +01:00
|
|
|
- php: 5.6
|
|
|
|
#CommentsListTest breaks with this env: DB=MYSQL CORE_RELEASE=3.2 COVERAGE=1
|
2017-01-17 05:33:39 +01:00
|
|
|
env: DB=SQLITE CORE_RELEASE=master COVERAGE=1
|
2015-11-19 02:18:53 +01:00
|
|
|
- php: 5.6
|
2017-01-17 05:33:39 +01:00
|
|
|
env: DB=MYSQL CORE_RELEASE=master
|
2015-11-19 02:18:53 +01:00
|
|
|
- php: 7.0
|
2017-01-17 05:33:39 +01:00
|
|
|
env: DB=MYSQL CORE_RELEASE=master
|
2017-01-16 06:10:05 +01:00
|
|
|
- php: 7.1
|
2017-01-17 05:33:39 +01:00
|
|
|
env: DB=MYSQL CORE_RELEASE=master
|
2017-01-16 06:10:05 +01:00
|
|
|
- php: 5.6
|
2017-01-17 05:33:39 +01:00
|
|
|
env: DB=PGSQL CORE_RELEASE=master
|
2013-03-29 09:33:51 +01:00
|
|
|
|
|
|
|
before_script:
|
2016-01-07 07:59:10 +01:00
|
|
|
- phpenv rehash
|
2015-11-19 02:18:53 +01:00
|
|
|
- composer self-update || true
|
2016-01-19 21:20:18 +01:00
|
|
|
- git clone git://github.com/silverstripe-labs/silverstripe-travis-support.git ~/travis-support
|
2016-01-07 07:59:10 +01:00
|
|
|
# Install suggested modules in order to maximize test coverage
|
2017-01-17 04:56:30 +01:00
|
|
|
- php ~/travis-support/travis_setup.php --source `pwd` --target ~/builds/ss --require "ezyang/htmlpurifier:4.*,silverstripe/cms:^4.0@dev"
|
2015-11-19 02:18:53 +01:00
|
|
|
- cd ~/builds/ss
|
2013-03-29 09:33:51 +01:00
|
|
|
|
2015-11-19 02:18:53 +01:00
|
|
|
script:
|
2016-01-07 07:59:10 +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"
|
|
|
|
|
|
|
|
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"
|