From 8e1f5171354007ead20f00eeeef9692779a7d862 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Mon, 24 Jul 2017 03:39:14 +0200 Subject: [PATCH] travis: use stages --- .travis.yml | 76 +++++++++++++++++++++++++++++------------------------ 1 file changed, 41 insertions(+), 35 deletions(-) diff --git a/.travis.yml b/.travis.yml index d3c074431..860d03cf9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,52 +7,58 @@ env: - PHP_BIN=php - PHP_BIN=php-cgi -matrix: - include: - - php: 7.1 - env: dependencies="--prefer-lowest --prefer-stable" PHP_BIN=php - - php: 7.1 - env: coverage=on - - php: 7.1 - env: codingStandard=on +before_install: + # turn off XDebug + - phpenv config-rm xdebug.ini || return 0 - allow_failures: - - php: 7.1 - env: coverage=on +install: + - travis_retry composer install --no-progress --prefer-dist script: - - if [ "$PHP_BIN" ]; then vendor/bin/tester -p $PHP_BIN tests -s $coverageArgs; fi - - > - if [ "$codingStandard" ]; then - php temp/code-checker/src/code-checker.php --short-arrays --strict-types - && php temp/coding-standard/ecs check src tests --config temp/coding-standard/coding-standard-php71.neon; - fi + - vendor/bin/tester -p $PHP_BIN tests -s after_failure: # Print *.actual content - for i in $(find tests -name \*.actual); do echo "--- $i"; cat $i; echo; echo; done -before_script: - # Install Nette Tester - - travis_retry composer update --no-interaction --prefer-dist $dependencies - # Install Code Checkers - - > - if [ "$codingStandard" ]; then - travis_retry composer create-project nette/code-checker temp/code-checker ~2 --no-interaction; - travis_retry composer create-project nette/coding-standard temp/coding-standard --no-interaction; - fi - - if [ "$coverage" ]; then PHP_BIN=phpdbg; coverageArgs="--coverage ./coverage.xml --coverage-src ./src"; fi - -after_script: - # Report Code Coverage - - > - if [ "$coverage" ]; then - wget https://github.com/satooshi/php-coveralls/releases/download/v1.0.1/coveralls.phar - && php coveralls.phar --verbose --config tests/.coveralls.yml; - fi +jobs: + include: + - env: title="Lowest Dependencies" + env: PHP_BIN=php + install: + - travis_retry composer update --no-progress --prefer-dist --prefer-lowest --prefer-stable + + + - stage: Code Standard Checker + php: 7.1 + install: + # Install Nette Code Checker + - travis_retry composer create-project nette/code-checker temp/code-checker ~2 --no-progress + # Install Nette Coding Standard + - travis_retry composer create-project nette/coding-standard temp/coding-standard --no-progress + + script: + - php temp/code-checker/src/code-checker.php --short-arrays --strict-types + - php temp/coding-standard/ecs check src tests --config temp/coding-standard/coding-standard-php71.neon + + + - stage: Code Coverage + script: + - vendor/bin/tester -p phpdbg tests -s --coverage ./coverage.xml --coverage-src ./src + after_script: + - wget https://github.com/satooshi/php-coveralls/releases/download/v1.0.1/coveralls.phar + - php coveralls.phar --verbose --config tests/.coveralls.yml + + + allow_failures: + - stage: Code Coverage + sudo: false cache: directories: - $HOME/.composer/cache + +notifications: + email: false