36 lines
1.0 KiB
YAML
36 lines
1.0 KiB
YAML
language: php
|
|
dist: trusty
|
|
sudo: false
|
|
|
|
php:
|
|
- 5.6
|
|
- 7.0
|
|
- 7.1
|
|
- 7.2
|
|
|
|
matrix:
|
|
include:
|
|
- php: 7.1
|
|
env: COVERAGE=1
|
|
|
|
cache:
|
|
directories:
|
|
- vendor
|
|
- $HOME/.composer/cache
|
|
|
|
before_script:
|
|
# Deactivate xdebug if we don't do code coverage
|
|
- if [ -z "$COVERAGE" ]; then rm -rfv /home/travis/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini ; fi
|
|
- composer install --ignore-platform-reqs
|
|
|
|
script:
|
|
# PHP_CodeSniffer
|
|
- if [ -n "$COVERAGE" ]; then ./vendor/bin/phpcs --report-width=200 --report-summary --report-full samples/ src/ tests/ --ignore=samples/Header.php --standard=PSR2 -n ; fi
|
|
# PHP-CS-Fixer
|
|
- if [ -n "$COVERAGE" ]; then ./vendor/bin/php-cs-fixer fix --diff --verbose --dry-run ; fi
|
|
# PHPUnit
|
|
- ./vendor/bin/phpunit $(if [ -n "$COVERAGE" ]; then echo --debug --coverage-clover coverage-clover.xml ; fi)
|
|
|
|
after_script:
|
|
- if [ -n "$COVERAGE" ]; then wget https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover tests/coverage-clover.xml ; fi
|