silverstripe-blog/.travis.yml

61 lines
1.6 KiB
YAML
Raw Normal View History

language: php
2013-10-10 00:24:17 +02:00
sudo: false
addons:
apt:
packages:
- tidy
before_install:
- pip install --user codecov
2013-10-10 00:38:08 +02:00
env:
global:
# 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:
- php: 5.5
env: DB=MYSQL CORE_RELEASE=4
- php: 5.6
env: DB=MYSQL CORE_RELEASE=4
- php: 5.6
env: DB=PGSQL CORE_RELEASE=4
- php: 5.6
env: DB=SQLITE CORE_RELEASE=4
- php: 7.0
env: DB=MYSQL CORE_RELEASE=4
- php: 7.1
env: DB=MYSQL CORE_RELEASE=4 COVERAGE=1
2013-10-10 00:24:17 +02:00
2013-10-10 00:38:08 +02:00
before_script:
- phpenv rehash
- composer self-update || true
- git clone git://github.com/silverstripe/silverstripe-travis-support.git ~/travis-support
- 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
- mv "$MODULE_PATH/phpunit.xml.dist" .
2013-10-10 00:38:08 +02:00
#Execute tests with or without coverage
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"
#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
- "if [ \"$COVERAGE\" = \"1\" ]; then travis_retry codecov; fi"