-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.travis.yml
63 lines (54 loc) · 1.95 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
sudo: false
dist: xenial
language: php
## Cache composer downloads.
cache:
directories:
# Cache directory for older Composer versions.
- $HOME/.composer/cache/files
# Cache directory for more recent Composer versions.
- $HOME/.cache/composer/files
php:
- 7.2
- nightly
matrix:
fast_finish: true
include:
- php: 7.3
env: EXTRA_CHECKS=1
- php: 7.4
env: COVERAGE=1
allow_failures:
- php: nightly
before_install:
# Speed up build time by disabling Xdebug when its not needed.
- if [[ $COVERAGE != "1" ]]; then phpenv config-rm xdebug.ini || echo 'No xdebug config.'; fi
## Packages
- sudo apt-get -qq update
before_script:
## Composer
- composer self-update
- composer install --prefer-dist
## PHPDocumentor
## - mkdir -p build/docs
## - mkdir -p build/coverage
script:
# Search for PHP syntax errors.
- find -L . -path ./vendor -prune -o -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l
## PHPUnit
- if [[ "$COVERAGE" == "1" && $TRAVIS_PHP_VERSION == "7.2" ]]; then phpunit -c ./unitTests/ --coverage-text --coverage-html ./build/coverage; fi
- if [[ "$COVERAGE" == "1" && $TRAVIS_PHP_VERSION != "7.2" ]]; then ./vendor/bin/phpunit -c ./unitTests/ --coverage-text --coverage-html ./build/coverage; fi
- if [[ "$COVERAGE" != "1" ]]; then ./vendor/bin/phpunit -c ./unitTests/; fi
# Validate the composer.json file.
# @link https://getcomposer.org/doc/03-cli.md#validate
- composer validate --no-check-all
## PHP_CodeSniffer
- if [[ "$EXTRA_CHECKS" == "1" ]]; then ./vendor/bin/phpcs --runtime-set ignore_warnings_on_exit 1 ./classes/src; fi
## PHP Copy/Paste Detector
# - if [[ "$EXTRA_CHECKS" == "1" ]]; then ./vendor/bin/phpcpd ./classes/src/; fi
## PHP Mess Detector
- if [[ "$EXTRA_CHECKS" == "1" ]]; then ./vendor/bin/phpmd ./classes/src/ text ./phpmd.xml.dist; fi
## PHPLOC
- if [[ "$EXTRA_CHECKS" == "1" ]]; then ./vendor/bin/phploc ./classes/src/; fi
notifications:
email: false