From ba927b4782165009b115dbc415c3a47f0826f2b0 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Mon, 24 Jul 2017 13:54:13 +0200 Subject: [PATCH] travis: use stages --- .travis.yml | 83 +++++++++++++++++++++++----------------------- tests/php-unix.ini | 2 -- 2 files changed, 42 insertions(+), 43 deletions(-) delete mode 100644 tests/php-unix.ini diff --git a/.travis.yml b/.travis.yml index 19f59eb0..d1354df9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,34 +1,11 @@ language: php php: - 7.1 + - 7.2 -env: -matrix: - include: - - php: 7.1 - env: coverage=on - - php: 7.1 - env: codingStandard=on - - allow_failures: - - php: 7.1 - env: coverage=on - -script: - - vendor/bin/tester tests -s -p php -c tests/php-unix.ini $coverageArgs - - > - 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 - -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 install --no-interaction --prefer-dist +before_install: + # turn off XDebug + - phpenv config-rm xdebug.ini || return 0 # Create databases.ini - cp ./tests/databases.travis.ini ./tests/databases.ini @@ -36,24 +13,48 @@ before_script: # Create Postgre database - psql -c 'CREATE DATABASE dibi_test' -U postgres - # 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 coverageArgs="-p phpdbg --coverage ./coverage.xml --coverage-src ./src"; fi +install: + - travis_retry composer install --no-interaction --prefer-dist + +script: + - vendor/bin/tester tests -s + +after_failure: + # Print *.actual content + - for i in $(find tests -name \*.actual); do echo "--- $i"; cat $i; echo; echo; done + +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-interaction + # Install Nette Coding Standard + - travis_retry composer create-project nette/coding-standard temp/coding-standard --no-interaction + script: + - php temp/code-checker/src/code-checker.php --short-arrays --strict-types + - php temp/coding-standard/ecs check src tests examples --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: + - php: 7.2 + - 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 diff --git a/tests/php-unix.ini b/tests/php-unix.ini deleted file mode 100644 index e3794e17..00000000 --- a/tests/php-unix.ini +++ /dev/null @@ -1,2 +0,0 @@ -[PHP] -;extension_dir = "./ext"