-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.travis.yml
40 lines (34 loc) · 1.06 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
language: php
# list any PHP version you want to test against
matrix:
include:
- php: 5.6
- php: 7.0
env: WITH_COVERAGE=true
- php: 7.1
# Commands to be run before your environment runs.
install: composer install
# Try if composer cache will speed up the build
#cache:
# directories:
# - $HOME/.composer/cache/files
before_script:
- if [[ "$WITH_COVERAGE" == "true" ]];
then
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter;
chmod +x ./cc-test-reporter;
./cc-test-reporter before-build;
fi
# omitting "script:" will default to phpunit
script:
- if [[ "$WITH_COVERAGE" == "true" ]];
then bin/phpunit --configuration tests/phpunit.xml --coverage-clover build/logs/clover.xml;
else bin/phpunit --configuration tests/phpunit.xml;
fi
after_script:
- if [[ "$WITH_COVERAGE" == "true" ]]; then
./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT;
fi
addons:
code_climate:
repo_token: $CODECLIMATE_REPO_TOKEN