diff --git a/.scrutinizer.yml b/.scrutinizer.yml new file mode 100644 index 00000000000..4ba4635114f --- /dev/null +++ b/.scrutinizer.yml @@ -0,0 +1,24 @@ +build: + environment: + php: + version: 7.1 + +before_commands: + - "composer install --no-dev --prefer-source" + +tools: + external_code_coverage: + timeout: 3600 + +filter: + excluded_paths: + - docs + - tools + +build_failure_conditions: + - 'elements.rating(<= C).new.exists' # No new classes/methods with a rating of C or worse allowed + - 'issues.label("coding-style").new.exists' # No new coding style issues allowed + - 'issues.severity(>= MAJOR).new.exists' # New issues of major or higher severity + - 'project.metric_change("scrutinizer.test_coverage", < 0)' # Code Coverage decreased from previous inspection + - 'patches.label("Doc Comments").new.exists' # No new doc comments patches allowed + - 'patches.label("Unused Use Statements").new.exists' # No new unused imports patches allowed diff --git a/.travis.coverage.sh b/.travis.coverage.sh new file mode 100644 index 00000000000..6b2b2d03168 --- /dev/null +++ b/.travis.coverage.sh @@ -0,0 +1,5 @@ +set -x +if [ "$TRAVIS_PHP_VERSION" = '7.1' ] ; then + wget https://scrutinizer-ci.com/ocular.phar + php ocular.phar code-coverage:upload --format=php-clover ./clover.xml +fi diff --git a/.travis.yml b/.travis.yml index 943d258976a..8c602c9b0ce 100644 --- a/.travis.yml +++ b/.travis.yml @@ -112,6 +112,9 @@ matrix: allow_failures: - php: nightly +after_script: + - sh .travis.coverage.sh + install: - travis_retry composer install diff --git a/README.md b/README.md index dd71f5079ce..de477e7bcd6 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ | [Master][Master] | [2.5][2.5] | |:----------------:|:----------:| | [![Build status][Master image]][Master] | [![Build status][2.5 image]][2.5] | +| [![Code Coverage](https://scrutinizer-ci.com/g/doctrine/dbal/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/doctrine/dbal/?branch=master) | [![Code Coverage](https://scrutinizer-ci.com/g/doctrine/dbal/badges/coverage.png?b=2.5)](https://scrutinizer-ci.com/g/doctrine/dbal/?branch=2.5) | Powerful database abstraction layer with many features for database schema introspection, schema management and PDO abstraction.