From df5e87ffef69c546a67dfada20977b4e0504119d Mon Sep 17 00:00:00 2001 From: David Grudl Date: Mon, 24 Jul 2017 13:40:33 +0200 Subject: [PATCH] travis: use stages --- .travis.yml | 74 ++++++++++++++++++++++++++--------------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4f57af44..43b14839 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,57 +8,57 @@ php: - 7.2 env: - - TESTER_PHP_BIN=php - - TESTER_PHP_BIN=php-cgi + - PHP_BIN=php + - PHP_BIN=php-cgi -matrix: - allow_failures: - - php: 7.0 - env: COVERAGE=on +before_install: + # turn off XDebug + - phpenv config-rm xdebug.ini || return 0 - include: - - php: 7.0 - env: COVERAGE=on - - php: 7.1 - env: CODING_STANDARD=on +install: + - travis_retry composer install --no-progress --prefer-dist script: - - > - if [ "$TESTER_PHP_BIN" ]; then - src/tester -p $TESTER_PHP_BIN --info - && src/tester -p $TESTER_PHP_BIN tests -s $COVERAGE_ARGS - && src/tester -p $TESTER_PHP_BIN -o none tests/fail.phptx; if [ $? -eq 0 ]; then echo "tests/fail.phptx SHOULD FAIL"; exit 1; else echo "fail checked"; fi; - fi - - > - if [ "$CODING_STANDARD" ]; then - php temp/code-checker/src/code-checker.php --short-arrays - && php temp/coding-standard/ecs check src tests --config tests/coding-standard.neon; - fi + - src/tester -p $PHP_BIN --info + - src/tester -p $PHP_BIN tests -s + - src/tester -p $PHP_BIN -o none tests/fail.phptx; if [ $? -eq 0 ]; then echo "tests/fail.phptx SHOULD FAIL"; exit 1; else echo "fail checked"; fi; after_failure: # Print *.actual content - for i in $(find tests -name \*.actual); do echo "--- $i"; cat $i; echo; echo; done -before_script: - # Install Code Checkers - - > - if [ "$CODING_STANDARD" ]; 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 +jobs: + include: + - 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 + - php temp/coding-standard/ecs check src tests --config tests/coding-standard.neon; + - - if [ "$COVERAGE" ]; then TESTER_PHP_BIN=phpdbg; COVERAGE_ARGS="--coverage ./coverage.xml --coverage-src ./src"; fi + - stage: Code Coverage + php: 7.1 + script: + - src/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 -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 sudo: false cache: directories: - $HOME/.composer/cache + +notifications: + email: false