From 6b04b515146281f490e295cb4f4d79e3a5139b25 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Wed, 20 Apr 2016 16:43:32 +0200 Subject: [PATCH] tests/travis: reports code coverage to Coveralls --- .travis.yml | 15 ++++++++++++--- composer.json | 2 +- readme.md | 1 + tests/.coveralls.yml | 4 ++++ 4 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 tests/.coveralls.yml diff --git a/.travis.yml b/.travis.yml index 1245a9505..a2798e046 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,9 +13,9 @@ 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 -i netteForms - - if [ $TRAVIS_PHP_VERSION == "5.6" ]; then grunt --gruntfile=tests/netteForms/Gruntfile.js test; fi + - if [ $TRAVIS_PHP_VERSION == "7.0" ]; then grunt --gruntfile=tests/netteForms/Gruntfile.js test; fi after_failure: # Print *.actual content @@ -25,7 +25,16 @@ 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 == "5.6" ]; then npm install -g grunt-cli; cd tests/netteForms; npm install; bower install; cd ../..; fi + - if [ $TRAVIS_PHP_VERSION == "7.0" ]; then npm install -g grunt-cli; cd tests/netteForms; npm install; bower install; cd ../..; fi + - 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/composer.json b/composer.json index b505e44ba..af8b04ff6 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ }, "require-dev": { "nette/di": "~2.3", - "nette/tester": "~1.3", + "nette/tester": "~1.7", "latte/latte": "~2.4", "tracy/tracy": "^2.3" }, diff --git a/readme.md b/readme.md index 059d54b60..8cd48e5b4 100644 --- a/readme.md +++ b/readme.md @@ -3,6 +3,7 @@ Nette Forms: greatly facilitates web forms [![Downloads this Month](https://img.shields.io/packagist/dm/nette/forms.svg)](https://packagist.org/packages/nette/forms) [![Build Status](https://travis-ci.org/nette/forms.svg?branch=master)](https://travis-ci.org/nette/forms) +[![Coverage Status](https://coveralls.io/repos/github/nette/forms/badge.svg?branch=master)](https://coveralls.io/github/nette/forms?branch=master) [![Latest Stable Version](https://poser.pugx.org/nette/forms/v/stable)](https://github.com/nette/forms/releases) [![License](https://img.shields.io/badge/license-New%20BSD-blue.svg)](https://github.com/nette/forms/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