silverstripe-comments/.travis.yml

58 lines
1.6 KiB
YAML

language: php
sudo: true
addons:
apt:
packages:
- tidy
php:
- 5.3
- 5.4
- 5.5
before_install:
- pip install --user codecov
env:
global:
- DB=MYSQL CORE_RELEASE=3.5
- MODULE_PATH=comments
# Set to 1 in the matrix to enable code coverage
- COVERAGE=0
matrix:
include:
- php: 5.6
#CommentsListTest breaks with this env: DB=MYSQL CORE_RELEASE=3.2 COVERAGE=1
env: DB=SQLITE CORE_RELEASE=3.5 COVERAGE=1
- php: 7.1
env: DB=MYSQL CORE_RELEASE=3.6
- php: 5.6
env: DB=PGSQL CORE_RELEASE=3.5
- php: 7.1
env: DB=MYSQL CORE_RELEASE=3
before_script:
- phpenv rehash
- composer self-update || true
- git clone git://github.com/silverstripe-labs/silverstripe-travis-support.git ~/travis-support
# Install suggested modules in order to maximize test coverage
- php ~/travis-support/travis_setup.php --source `pwd` --target ~/builds/ss --require "ezyang/htmlpurifier:4.*,silverstripe/cms:~3.1"
- cd ~/builds/ss
script:
# 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"