-
Notifications
You must be signed in to change notification settings - Fork 5
/
.travis.yml
55 lines (46 loc) · 1.36 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
54
55
language: php
matrix:
fast_finish: true
include:
- php: "7.4snapshot"
# Only run coverage on 7.2
- php: 7.2
env:
- TASK_TESTS_COVERAGE=1
- CC_TEST_REPORTER_ID=73ac12e5967d8ba64ad3ceb67b69f56176f50008820ffaacd14efab909b3f9b6
- php: 7.1
cache:
directories:
- vendor
- $HOME/.composer/cache
install:
# show versions and env information
- php --version
- composer --version
- pg_config --version
# disable xdebug for performance reasons when code coverage is not needed.
- |
if [[ $TASK_TESTS_COVERAGE != 1 ]]; then
phpenv config-rm xdebug.ini || echo "xdebug is not installed"
fi
# Install dependencies
- travis_retry composer self-update
- travis_retry composer install --prefer-source --no-interaction --dev
before_script:
# Enable code coverage
- |
if [ $TASK_TESTS_COVERAGE == 1 ]; then
PHPUNIT_FLAGS="--coverage-clover=$TRAVIS_BUILD_DIR/build/logs/clover.xml"
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
script:
- composer lint
- composer sniff
- vendor/bin/phpunit --verbose $PHPUNIT_FLAGS
after_script:
- |
if [ $TASK_TESTS_COVERAGE == 1 ]; then
./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
fi