Skip to content

Commit df5e87f

Browse files
committed
travis: use stages
1 parent aef15cb commit df5e87f

File tree

1 file changed

+37
-37
lines changed

1 file changed

+37
-37
lines changed

.travis.yml

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -8,57 +8,57 @@ php:
88
- 7.2
99

1010
env:
11-
- TESTER_PHP_BIN=php
12-
- TESTER_PHP_BIN=php-cgi
11+
- PHP_BIN=php
12+
- PHP_BIN=php-cgi
1313

14-
matrix:
15-
allow_failures:
16-
- php: 7.0
17-
env: COVERAGE=on
14+
before_install:
15+
# turn off XDebug
16+
- phpenv config-rm xdebug.ini || return 0
1817

19-
include:
20-
- php: 7.0
21-
env: COVERAGE=on
22-
- php: 7.1
23-
env: CODING_STANDARD=on
18+
install:
19+
- travis_retry composer install --no-progress --prefer-dist
2420

2521
script:
26-
- >
27-
if [ "$TESTER_PHP_BIN" ]; then
28-
src/tester -p $TESTER_PHP_BIN --info
29-
&& src/tester -p $TESTER_PHP_BIN tests -s $COVERAGE_ARGS
30-
&& 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;
31-
fi
32-
- >
33-
if [ "$CODING_STANDARD" ]; then
34-
php temp/code-checker/src/code-checker.php --short-arrays
35-
&& php temp/coding-standard/ecs check src tests --config tests/coding-standard.neon;
36-
fi
22+
- src/tester -p $PHP_BIN --info
23+
- src/tester -p $PHP_BIN tests -s
24+
- 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;
3725

3826
after_failure:
3927
# Print *.actual content
4028
- for i in $(find tests -name \*.actual); do echo "--- $i"; cat $i; echo; echo; done
4129

42-
before_script:
43-
# Install Code Checkers
44-
- >
45-
if [ "$CODING_STANDARD" ]; then
46-
travis_retry composer create-project nette/code-checker temp/code-checker ~2 --no-interaction;
47-
travis_retry composer create-project nette/coding-standard temp/coding-standard --no-interaction;
48-
fi
30+
jobs:
31+
include:
32+
- stage: Code Standard Checker
33+
php: 7.1
34+
install:
35+
# Install Nette Code Checker
36+
- travis_retry composer create-project nette/code-checker temp/code-checker ~2 --no-progress
37+
# Install Nette Coding Standard
38+
- travis_retry composer create-project nette/coding-standard temp/coding-standard --no-progress
39+
script:
40+
- php temp/code-checker/src/code-checker.php --short-arrays
41+
- php temp/coding-standard/ecs check src tests --config tests/coding-standard.neon;
42+
4943

50-
- if [ "$COVERAGE" ]; then TESTER_PHP_BIN=phpdbg; COVERAGE_ARGS="--coverage ./coverage.xml --coverage-src ./src"; fi
44+
- stage: Code Coverage
45+
php: 7.1
46+
script:
47+
- src/tester -p phpdbg tests -s --coverage ./coverage.xml --coverage-src ./src
48+
after_script:
49+
- wget https://github.com/satooshi/php-coveralls/releases/download/v1.0.1/coveralls.phar
50+
- php coveralls.phar --verbose --config tests/.coveralls.yml
51+
52+
53+
allow_failures:
54+
- stage: Code Coverage
5155

52-
after_script:
53-
# Report Code Coverage
54-
- >
55-
if [ "$COVERAGE" ]; then
56-
wget https://github.com/satooshi/php-coveralls/releases/download/v1.0.1/coveralls.phar
57-
&& php coveralls.phar --verbose --config tests/.coveralls.yml;
58-
fi
5956

6057
sudo: false
6158

6259
cache:
6360
directories:
6461
- $HOME/.composer/cache
62+
63+
notifications:
64+
email: false

0 commit comments

Comments
 (0)