diff --git a/.travis.yml b/.travis.yml index e8d42a69c..fe4554bac 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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: @@ -24,6 +24,15 @@ 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 + +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 diff --git a/readme.md b/readme.md index 9cd2b4a39..e6185789c 100644 --- a/readme.md +++ b/readme.md @@ -3,6 +3,7 @@ Nette Dependency Injection (DI) [![Downloads this Month](https://img.shields.io/packagist/dm/nette/di.svg)](https://packagist.org/packages/nette/di) [![Build Status](https://travis-ci.org/nette/di.svg?branch=master)](https://travis-ci.org/nette/di) +[![Coverage Status](https://coveralls.io/repos/github/nette/di/badge.svg?branch=master)](https://coveralls.io/github/nette/di?branch=master) [![Latest Stable Version](https://poser.pugx.org/nette/di/v/stable)](https://github.com/nette/di/releases) [![License](https://img.shields.io/badge/license-New%20BSD-blue.svg)](https://github.com/nette/di/blob/master/license.md) diff --git a/tests/.coveralls.yml b/tests/.coveralls.yml new file mode 100644 index 000000000..82764a3f5 --- /dev/null +++ b/tests/.coveralls.yml @@ -0,0 +1,4 @@ +# for php-coveralls +service_name: travis-ci +coverage_clover: coverage.xml +json_path: coverage.json