From 0fec1255bd2d062229e81cad3bfba806a8ea6096 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Wed, 20 Apr 2016 17:36:32 +0200 Subject: [PATCH] tests/travis: reports code coverage to Coveralls --- .travis.yml | 13 +++++++++++-- composer.json | 2 +- readme.md | 1 + tests/.coveralls.yml | 4 ++++ 4 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 tests/.coveralls.yml diff --git a/.travis.yml b/.travis.yml index 2652019..07dd43f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: php php: - - 5.3.3 + - 5.3 - 5.4 - 5.5 - 5.6 @@ -12,7 +12,7 @@ matrix: - php: hhvm script: - - vendor/bin/tester tests -s -p php + - vendor/bin/tester tests -s -p php $coverage - php code-checker/src/code-checker.php -d src after_failure: @@ -23,6 +23,15 @@ before_script: # Install Nette Tester & Code Checker - travis_retry composer install --no-interaction --prefer-dist - travis_retry composer create-project nette/code-checker 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/composer.json b/composer.json index c326c35..5b1f6c3 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ "php": ">=5.3.1" }, "require-dev": { - "nette/tester": "~1.0", + "nette/tester": "~1.7", "tracy/tracy": "^2.3" }, "conflict": { diff --git a/readme.md b/readme.md index 5a26a2c..63936a5 100644 --- a/readme.md +++ b/readme.md @@ -3,6 +3,7 @@ Nette Tokenizer [![Downloads this Month](https://img.shields.io/packagist/dm/nette/tokenizer.svg)](https://packagist.org/packages/nette/tokenizer) [![Build Status](https://travis-ci.org/nette/tokenizer.svg?branch=master)](https://travis-ci.org/nette/tokenizer) +[![Coverage Status](https://coveralls.io/repos/github/nette/tokenizer/badge.svg?branch=master)](https://coveralls.io/github/nette/tokenizer?branch=master) [![Latest Stable Version](https://poser.pugx.org/nette/tokenizer/v/stable)](https://github.com/nette/tokenizer/releases) [![License](https://img.shields.io/badge/license-New%20BSD-blue.svg)](https://github.com/nette/tokenizer/blob/master/license.md) diff --git a/tests/.coveralls.yml b/tests/.coveralls.yml new file mode 100644 index 0000000..82764a3 --- /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