@@ -18,28 +18,43 @@ matrix:
1818 include :
1919 - php : 7.0
2020 env : COVERAGE=on
21+ - php : 7.1
22+ env : CODING_STANDARD=on
2123
2224script :
23- - src/tester -p $TESTER_PHP_BIN --info
24- - src/tester -p $TESTER_PHP_BIN tests -s $COVERAGE_ARGS
25- - 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;
26- - php code-checker/src/code-checker.php --no-progress --short-arrays
25+ - >
26+ if [ "$TESTER_PHP_BIN" ]; then
27+ src/tester -p $TESTER_PHP_BIN --info
28+ && src/tester -p $TESTER_PHP_BIN tests -s $COVERAGE_ARGS
29+ && 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;
30+ fi
31+ - >
32+ if [ "$CODING_STANDARD" ]; then
33+ php temp/code-checker/src/code-checker.php --short-arrays
34+ && php temp/coding-standard/ecs check src tests --config tests/coding-standard.neon;
35+ fi
2736
2837after_failure :
2938 # Print *.actual content
3039 - for i in $(find tests -name \*.actual); do echo "--- $i"; cat $i; echo; echo; done
3140
3241before_script :
33- - travis_retry composer create-project nette/code-checker code-checker ~2.5 --no-interaction
34- - if [ "$COVERAGE" == "on" ]; then TESTER_PHP_BIN=phpdbg; COVERAGE_ARGS="--coverage ./coverage.xml --coverage-src ./src"; fi
42+ # Install Code Checkers
43+ - >
44+ if [ "$CODING_STANDARD" ]; then
45+ travis_retry composer create-project nette/code-checker temp/code-checker ~2 --no-interaction;
46+ travis_retry composer create-project nette/coding-standard temp/coding-standard --no-interaction;
47+ fi
48+
49+ - if [ "$COVERAGE" ]; then TESTER_PHP_BIN=phpdbg; COVERAGE_ARGS="--coverage ./coverage.xml --coverage-src ./src"; fi
3550
3651after_script :
3752 # Report Code Coverage
3853 - >
39- if [ "$COVERAGE" == "on" ]; then
54+ if [ "$COVERAGE" ]; then
4055 wget https://github.com/satooshi/php-coveralls/releases/download/v1.0.1/coveralls.phar
41- && php coveralls.phar --verbose --config tests/.coveralls.yml
42- || true; fi
56+ && php coveralls.phar --verbose --config tests/.coveralls.yml;
57+ fi
4358
4459sudo : false
4560
0 commit comments