-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.travis.yml
50 lines (50 loc) · 1.14 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
sudo: false
language: php
cache:
directories:
- vendor
- $HOME/.composer/cache
matrix:
include:
- php: 7.2
env: PHPLINT=1 PHPCS=1 COVERAGE=1
- php: 7.1
- php: 7.0
allow_failures:
- php: nightly
before_script:
- composer self-update
- composer install
- |
if [[ "$COVERAGE" == "1" ]]; 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
script:
- |
if [[ "$PHPLINT" == "1" ]]; then
find -L . -path ./vendor -prune -o -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l
fi
- |
if [[ "$PHPCS" == "1" ]]; then
vendor/bin/phpcs -v --runtime-set ignore_warnings_on_exit 1
fi
- |
if [[ -z "$CODECLIMATE_REPO_TOKEN" ]]; then
COVERAGE="0"
fi
- |
if [[ "$COVERAGE" == "1" ]]; then
mkdir -p build/logs
vendor/bin/phpunit -c phpunit.xml --coverage-clover build/logs/clover.xml
else
vendor/bin/phpunit -c phpunit.xml
fi
after_script:
- |
if [[ "$COVERAGE" == "1" ]]; then
./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
fi
notifications:
email: false