/
.travis.yml
69 lines (69 loc) · 1.51 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
sudo: false
dist: trusty
language: php
cache:
directories:
- vendor
- $HOME/.composer/cache
matrix:
include:
- php: 7.2
env: UNIT=1 PHPLINT=1 PHPCS=1 COVERAGE=1
- php: 7.0
env: UNIT=1 PHPLINT=1
dist: trusty
- php: nightly
env: UNIT=1
allow_failures:
- php: nightly
env: UNIT=1
before_install:
- |
if [[ -z "$CC_TEST_REPORTER_ID" ]]; then
COVERAGE="0"
fi
- |
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
- |
if [[ "$COVERAGE" != "1" ]]; then
stable='^[0-9\.]+$'
if [[ "$TRAVIS_PHP_VERSION" =~ $stable ]]; then
phpenv config-rm xdebug.ini
fi
fi
- composer install
before_script:
- phpenv rehash
script:
- |
if [[ "$PHPLINT" == "1" ]]; then
composer run-script phplint
fi
- |
if [[ "$PHPCS" == "1" ]]; then
composer run-script phpcs
fi
- |
if [[ "$PHPMD" == "1" ]]; then
composer run-script phpmd
fi
- |
if [[ "$UNIT" == "1" ]]; then
if [[ "$COVERAGE" == "1" ]]; then
mkdir -p tests/logs
vendor/bin/phpunit --coverage-clover tests/logs/clover.xml
else
vendor/bin/phpunit
fi
fi
after_script:
- |
if [[ "$COVERAGE" == "1" ]]; then
./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
fi
notifications:
email: false