Skip to content

Commit

Permalink
travis: use stages
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Jul 24, 2017
1 parent aef15cb commit df5e87f
Showing 1 changed file with 37 additions and 37 deletions.
74 changes: 37 additions & 37 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit df5e87f

Please sign in to comment.