From ea901bb65e2c5cef7d08227e490b37e85c4951dd Mon Sep 17 00:00:00 2001 From: Gordon Anderson Date: Wed, 24 Feb 2016 21:03:05 +0700 Subject: [PATCH] ENHANCEMENT: Addition of code coverage and badges --- .travis.yml | 28 ++++++++++++++++++++++++++-- README.md | 18 +++++++++++++++++- 2 files changed, 43 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index f6d9e3a..e0b9e21 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,10 @@ php: - 7.0 env: - - DB=MYSQL CORE_RELEASE=3.2 + global: + - DB=MYSQL CORE_RELEASE=3.2 + - MODULE_PATH=iframe + - COVERAGE=0 matrix: include: @@ -22,8 +25,18 @@ matrix: env: DB=MYSQL CORE_RELEASE=3.1 - php: 5.6 env: DB=PGSQL CORE_RELEASE=3.2 + - php: 5.6 + env: DB=MYSQL CORE_RELEASE=3.3 + # Allowed to fail, meaning delayed code coverage reports + - php: 5.5.9 + env: DB=MYSQL CORE_RELEASE=3.2 COVERAGE=1 allow_failures: - php: 7.0 + - php: 5.5.9 + fast_finish: true + +before_install: + - pip install --user codecov before_script: - composer self-update || true @@ -33,4 +46,15 @@ before_script: - composer install script: - - vendor/bin/phpunit iframe/tests + # Execute tests with no coverage. This is the fastest option + - "if [ \"$COVERAGE\" = \"0\" ]; then vendor/bin/phpunit $MODULE_PATH/tests/; fi" + + # Execute tests with coverage. Do this for a small + - "if [ \"$COVERAGE\" = \"1\" ]; then vendor/bin/phpunit --coverage-clover=coverage.clover $MODULE_PATH/tests/; fi" + +after_script: + - "if [ \"$COVERAGE\" = \"1\" ]; then mv coverage.clover ~/build/$TRAVIS_REPO_SLUG/; fi" + - cd ~/build/$TRAVIS_REPO_SLUG + - wget https://scrutinizer-ci.com/ocular.phar + - "if [ \"$COVERAGE\" = \"1\" ]; then travis_retry codecov && travis_retry php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi" + diff --git a/README.md b/README.md index 300cce3..bf8fa23 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,20 @@ # IFrame module +[![Build Status](https://travis-ci.org/silverstripe-labs/silverstripe-iframe.svg?branch=master)](https://travis-ci.org/silverstripe-labs/silverstripe-iframe) +[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/silverstripe-labs/silverstripe-iframe/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/silverstripe-labs/silverstripe-iframe/?branch=master) +[![Build Status](https://scrutinizer-ci.com/g/silverstripe-labs/silverstripe-iframe/badges/build.png?b=master)](https://scrutinizer-ci.com/g/silverstripe-labs/silverstripe-iframe/build-status/master) +[![codecov.io](https://codecov.io/github/silverstripe-labs/silverstripe-iframe/coverage.svg?branch=master)](https://codecov.io/github/silverstripe-labs/silverstripe-iframe?branch=master) + +[![Latest Stable Version](https://poser.pugx.org/silverstripe/iframe/version)](https://packagist.org/packages/silverstripe/iframe) +[![Latest Unstable Version](https://poser.pugx.org/silverstripe/iframe/v/unstable)](//packagist.org/packages/silverstripe/iframe) +[![Total Downloads](https://poser.pugx.org/silverstripe/iframe/downloads)](https://packagist.org/packages/silverstripe/iframe) +[![License](https://poser.pugx.org/silverstripe/iframe/license)](https://packagist.org/packages/silverstripe/iframe) +[![Monthly Downloads](https://poser.pugx.org/silverstripe/iframe/d/monthly)](https://packagist.org/packages/silverstripe/iframe) +[![Daily Downloads](https://poser.pugx.org/silverstripe/iframe/d/daily)](https://packagist.org/packages/silverstripe/iframe) + +[![Dependency Status](https://www.versioneye.com/php/silverstripe:iframe/badge.svg)](https://www.versioneye.com/php/silverstripe:iframe) +[![Reference Status](https://www.versioneye.com/php/silverstripe:iframe/reference_badge.svg?style=flat)](https://www.versioneye.com/php/silverstripe:iframe/references) + +![codecov.io](https://codecov.io/github/silverstripe-labs/silverstripe-iframe/branch.svg?branch=master) ## Introduction @@ -24,4 +40,4 @@ For usage instructions see [user manual](docs/en/userguide/index.md). Translations of the natural language strings are managed through a third party translation interface, transifex.com. Newly added strings will be periodically uploaded there for translation, and any new translations will be merged back to the project source code. -Please use [https://www.transifex.com/projects/p/silverstripe-iframe](https://www.transifex.com/projects/p/silverstripe-iframe) to contribute translations, rather than sending pull requests with YAML files. \ No newline at end of file +Please use [https://www.transifex.com/projects/p/silverstripe-iframe](https://www.transifex.com/projects/p/silverstripe-iframe) to contribute translations, rather than sending pull requests with YAML files.