Use stages for Travis

This commit is contained in:
Adrien Crivelli 2018-01-28 18:07:51 +09:00
parent 23896213ac
commit 84f012f4bb
No known key found for this signature in database
GPG Key ID: B182FD79DC6DE92E
1 changed files with 20 additions and 15 deletions

View File

@ -8,28 +8,33 @@ php:
- 7.1 - 7.1
- 7.2 - 7.2
matrix:
include:
- php: 7.1
env: COVERAGE=1
cache: cache:
directories: directories:
- vendor - vendor
- $HOME/.composer/cache - $HOME/.composer/cache
before_script: before_script:
# Deactivate xdebug if we don't do code coverage # Deactivate xdebug
- if [ -z "$COVERAGE" ]; then rm -rfv /home/travis/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini ; fi - if [ -z "$KEEP_XDEBUG" ]; then rm -rfv /home/travis/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini ; fi
- composer install --ignore-platform-reqs - composer install --ignore-platform-reqs
script: script:
# PHP_CodeSniffer - ./vendor/bin/phpunit
- 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: jobs:
- 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 include:
- stage: Code style
php: 7.1
script:
- ./vendor/bin/php-cs-fixer fix --diff --verbose --dry-run
- ./vendor/bin/phpcs --report-width=200 --report-summary --report-full samples/ src/ tests/ --ignore=samples/Header.php --standard=PSR2 -n
- stage: Coverage
php: 7.1
env: KEEP_XDEBUG=1
script:
- ./vendor/bin/phpunit --debug --coverage-clover coverage-clover.xml
after_script:
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover tests/coverage-clover.xml