-
Notifications
You must be signed in to change notification settings - Fork 60
/
.travis.yml
54 lines (42 loc) · 1.35 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
language: php
sudo: false
addons:
apt:
packages:
- tidy
before_install:
- pip install --user codecov
env:
global:
- DB=MYSQL CORE_RELEASE=4.0
- MODULE_PATH=blocks
- COVERAGE=0
matrix:
include:
- php: 7.0
env: DB=SQLITE
- php: 7.0
env: DB=PGSQL
- php: 7.0
env: COVERAGE=1
- php: 5.6
allow_failures:
- php: 7.0
env: DB=SQLITE
before_script:
- phpenv rehash
- composer self-update || true
- git clone git://github.com/silverstripe-labs/silverstripe-travis-support.git ~/travis-support
- php ~/travis-support/travis_setup.php --source `pwd` --target ~/builds/ss
- cd ~/builds/ss
- mv "$MODULE_PATH/phpunit.xml.dist" .
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"