Skip to content

Commit

Permalink
tests/travis: reports code coverage to Coveralls
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Apr 21, 2016
1 parent 008de64 commit 15835de
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
12 changes: 10 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ matrix:

include:
- php: 7.0
env: TESTER_PHP_BIN=phpdbg
env: TESTER_PHP_BIN=phpdbg COVERAGE="--coverage ./coverage.xml --coverage-src ./src"

script:
- src/tester -p $TESTER_PHP_BIN tests -s
- src/tester -p $TESTER_PHP_BIN tests -s $COVERAGE
- 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;
- php code-checker/src/code-checker.php

Expand All @@ -34,6 +34,14 @@ after_failure:
before_script:
- travis_retry composer create-project nette/code-checker code-checker ~2.5 --no-interaction

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
|| true; fi
sudo: false

cache:
Expand Down
4 changes: 4 additions & 0 deletions tests/.coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# for php-coveralls
service_name: travis-ci
coverage_clover: coverage.xml
json_path: coverage.json

0 comments on commit 15835de

Please sign in to comment.