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 2cb55e8 commit 0771c2f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
11 changes: 10 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ matrix:
env: dependencies="--prefer-lowest --prefer-stable"

script:
- vendor/bin/tester tests -s -p php -c tests/php-unix.ini
- vendor/bin/tester tests -s -p php -c tests/php-unix.ini $COVERAGE
- php temp/code-checker/src/code-checker.php --short-arrays

after_failure:
Expand All @@ -24,13 +24,22 @@ before_script:
# Install Nette Tester & Code Checker
- travis_retry composer update --no-interaction --prefer-dist $dependencies
- travis_retry composer create-project nette/code-checker temp/code-checker ~2.5 --no-interaction
- if [ $TRAVIS_PHP_VERSION == "7.0" ]; then coverage="-p phpdbg --coverage ./coverage.xml --coverage-src ./src"; fi

# Create databases.ini
- cp ./tests/databases.travis.ini ./tests/Database/databases.ini

# Create Postgre database
- psql -c 'CREATE DATABASE nette_test' -U postgres

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
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"nette/utils": "~2.4"
},
"require-dev": {
"nette/tester": "~1.3",
"nette/tester": "~1.7",
"nette/di": "~2.3",
"mockery/mockery": "~1.0.0",
"tracy/tracy": "^2.3"
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 0771c2f

Please sign in to comment.