Unverified Commit 6aa9325e authored by Grégoire Paris's avatar Grégoire Paris Committed by GitHub

Merge pull request #4009 from greg0ire/coverage-with-coveralls

Coveralls integration
parents aa382e4e e02d2cff
...@@ -12,7 +12,6 @@ cache: ...@@ -12,7 +12,6 @@ cache:
- C:\tools\php -> .appveyor.yml - C:\tools\php -> .appveyor.yml
- C:\tools\cacert -> .appveyor.yml - C:\tools\cacert -> .appveyor.yml
- C:\tools\composer -> .appveyor.yml - C:\tools\composer -> .appveyor.yml
- C:\tools\ocular -> .appveyor.yml
- '%LOCALAPPDATA%\Composer\files -> composer.json' - '%LOCALAPPDATA%\Composer\files -> composer.json'
## Build matrix for lowest and highest possible targets ## Build matrix for lowest and highest possible targets
...@@ -21,26 +20,22 @@ environment: ...@@ -21,26 +20,22 @@ environment:
- db: mssql - db: mssql
driver: sqlsrv driver: sqlsrv
db_version: sql2008r2sp2 db_version: sql2008r2sp2
coverage: yes
php: 7.3 php: 7.3
- db: mssql - db: mssql
driver: sqlsrv driver: sqlsrv
db_version: sql2012sp1 db_version: sql2012sp1
php: 7.3 php: 7.3
coverage: yes
- db: mssql - db: mssql
driver: sqlsrv driver: sqlsrv
db_version: sql2017 db_version: sql2017
coverage: no
php: 7.3 php: 7.3
- db: mssql - db: mssql
driver: pdo_sqlsrv driver: pdo_sqlsrv
db_version: sql2017 db_version: sql2017
php: 7.3 php: 7.3
coverage: yes
init: init:
- SET PATH=C:\Program Files\OpenSSL;c:\tools\php;C:\tools\composer;C:\tools\ocular;%PATH% - SET PATH=C:\Program Files\OpenSSL;c:\tools\php;C:\tools\composer;%PATH%
- SET COMPOSER_NO_INTERACTION=1 - SET COMPOSER_NO_INTERACTION=1
- SET ANSICON=121x90 (121x90) - SET ANSICON=121x90 (121x90)
...@@ -99,15 +94,6 @@ install: ...@@ -99,15 +94,6 @@ install:
Set-Content -path 'C:\tools\composer\composer.bat' -Value ('@php C:\tools\composer\composer.phar %*') Set-Content -path 'C:\tools\composer\composer.bat' -Value ('@php C:\tools\composer\composer.phar %*')
} }
# download Scrutinizer's Ocular
if (!(Test-Path C:\tools\ocular)) {
New-Item -path c:\tools -name ocular -itemtype directory
}
if (!(Test-Path c:\tools\ocular\ocular.phar)) {
appveyor-retry appveyor DownloadFile https://github.com/scrutinizer-ci/ocular/releases/download/1.5.2/ocular.phar -Filename C:\tools\ocular\ocular.phar
Set-Content -path 'C:\tools\ocular\ocular.bat' -Value ('@php C:\tools\ocular\ocular.phar %*')
}
# download CA bundle # download CA bundle
if (!(Test-Path C:\tools\cacert)) { if (!(Test-Path C:\tools\cacert)) {
New-Item -path c:\tools\ -name cacert -itemtype directory New-Item -path c:\tools\ -name cacert -itemtype directory
...@@ -137,18 +123,8 @@ test_script: ...@@ -137,18 +123,8 @@ test_script:
$env:phpunit_config = "tests\appveyor\$($env:db).$($env:driver).appveyor.xml" $env:phpunit_config = "tests\appveyor\$($env:db).$($env:driver).appveyor.xml"
} }
if ($env:coverage -eq "yes") {
vendor\bin\phpunit -c $($env:phpunit_config) --coverage-clover clover.xml
} else {
vendor\bin\phpunit -c $($env:phpunit_config) vendor\bin\phpunit -c $($env:phpunit_config)
}
if ($LastExitCode -ne 0) { if ($LastExitCode -ne 0) {
$host.SetShouldExit($LastExitCode) $host.SetShouldExit($LastExitCode)
} }
after_test:
- ps: >-
if ($env:coverage -eq "yes") {
appveyor-retry ocular code-coverage:upload --format=php-clover clover.xml
}
coverage_clover: clover.xml
json_path: /tmp/coveralls-upload.json
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
/.gitattributes export-ignore /.gitattributes export-ignore
/.github export-ignore /.github export-ignore
/.gitignore export-ignore /.gitignore export-ignore
/.scrutinizer.yml export-ignore
/.travis.yml export-ignore /.travis.yml export-ignore
/build.properties export-ignore /build.properties export-ignore
/build.xml export-ignore /build.xml export-ignore
......
build:
nodes:
analysis:
environment:
php:
version: 7.2
cache:
disabled: false
directories:
- ~/.composer/cache
project_setup:
override: true
tests:
override:
- php-scrutinizer-run
before_commands:
- "composer install --no-dev --prefer-source -a"
tools:
external_code_coverage:
timeout: 3600
runs: 27 # 23x Travis (jobs with COVERAGE=yes) + 3x AppVeyor (jobs with coverage=yes) + 1x ContinuousPHP
filter:
excluded_paths:
- docs
build_failure_conditions:
- 'elements.rating(<= C).new.exists' # No new classes/methods with a rating of C or worse 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("Unused Use Statements").new.exists' # No new unused imports patches allowed
...@@ -11,6 +11,8 @@ before_install: ...@@ -11,6 +11,8 @@ before_install:
- | - |
if [ "x$COVERAGE" == "xyes" ]; then if [ "x$COVERAGE" == "xyes" ]; then
pecl install pcov-1.0.0 pecl install pcov-1.0.0
wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.2.0/php-coveralls.phar --output-document="${HOME}/bin/coveralls"
chmod +x ${HOME}/bin/coveralls
fi fi
before_script: before_script:
...@@ -34,8 +36,7 @@ script: ...@@ -34,8 +36,7 @@ script:
after_script: after_script:
- | - |
if [ "x$COVERAGE" == "xyes" ]; then if [ "x$COVERAGE" == "xyes" ]; then
travis_retry wget https://github.com/scrutinizer-ci/ocular/releases/download/1.5.2/ocular.phar travis_retry coveralls -v
travis_retry php ocular.phar code-coverage:upload --format=php-clover clover.xml
fi fi
jobs: jobs:
......
...@@ -4,8 +4,7 @@ ...@@ -4,8 +4,7 @@
|:----------------:|:----------:| |:----------------:|:----------:|
| [![Build status][Master image]][Master] | [![Build status][2.10 image]][2.10] | | [![Build status][Master image]][Master] | [![Build status][2.10 image]][2.10] |
| [![Build Status][ContinuousPHP image]][ContinuousPHP] | [![Build Status][ContinuousPHP 2.10 image]][ContinuousPHP] | | [![Build Status][ContinuousPHP image]][ContinuousPHP] | [![Build Status][ContinuousPHP 2.10 image]][ContinuousPHP] |
| [![Code Coverage][Coverage image]][Scrutinizer Master] | [![Code Coverage][Coverage 2.10 image]][Scrutinizer 2.10] | | [![Code Coverage][Coverage image]][Coveralls Master] | [![Code Coverage][Coverage 2.10 image]][Coveralls 2.10] |
| [![Code Quality][Quality image]][Scrutinizer Master] | [![Code Quality][Quality 2.10 image]][Scrutinizer 2.10] |
| [![AppVeyor][AppVeyor master image]][AppVeyor master] | [![AppVeyor][AppVeyor 2.10 image]][AppVeyor 2.10] | | [![AppVeyor][AppVeyor master image]][AppVeyor master] | [![AppVeyor][AppVeyor 2.10 image]][AppVeyor 2.10] |
Powerful database abstraction layer with many features for database schema introspection, schema management and PDO abstraction. Powerful database abstraction layer with many features for database schema introspection, schema management and PDO abstraction.
...@@ -17,20 +16,18 @@ Powerful database abstraction layer with many features for database schema intro ...@@ -17,20 +16,18 @@ Powerful database abstraction layer with many features for database schema intro
* [Issue Tracker](https://github.com/doctrine/dbal/issues) * [Issue Tracker](https://github.com/doctrine/dbal/issues)
[Master image]: https://img.shields.io/travis/doctrine/dbal/master.svg?style=flat-square [Master image]: https://img.shields.io/travis/doctrine/dbal/master.svg?style=flat-square
[Coverage image]: https://img.shields.io/scrutinizer/coverage/g/doctrine/dbal/master.svg?style=flat-square [Coverage image]: https://coveralls.io/repos/github/doctrine/dbal/badge.svg?branch=master
[Quality image]: https://img.shields.io/scrutinizer/g/doctrine/dbal/master.svg?style=flat-square
[ContinuousPHP image]: https://img.shields.io/continuousphp/git-hub/doctrine/dbal/master.svg?style=flat-square [ContinuousPHP image]: https://img.shields.io/continuousphp/git-hub/doctrine/dbal/master.svg?style=flat-square
[Master]: https://travis-ci.org/doctrine/dbal [Master]: https://travis-ci.org/doctrine/dbal
[Scrutinizer Master]: https://scrutinizer-ci.com/g/doctrine/dbal/ [Coveralls Master]: https://coveralls.io/github/doctrine/dbal?branch=master
[AppVeyor master]: https://ci.appveyor.com/project/doctrine/dbal/branch/master [AppVeyor master]: https://ci.appveyor.com/project/doctrine/dbal/branch/master
[AppVeyor master image]: https://ci.appveyor.com/api/projects/status/i88kitq8qpbm0vie/branch/master?svg=true [AppVeyor master image]: https://ci.appveyor.com/api/projects/status/i88kitq8qpbm0vie/branch/master?svg=true
[ContinuousPHP]: https://continuousphp.com/git-hub/doctrine/dbal [ContinuousPHP]: https://continuousphp.com/git-hub/doctrine/dbal
[2.10 image]: https://img.shields.io/travis/doctrine/dbal/2.10.x.svg?style=flat-square [2.10 image]: https://img.shields.io/travis/doctrine/dbal/2.10.x.svg?style=flat-square
[Coverage 2.10 image]: https://img.shields.io/scrutinizer/coverage/g/doctrine/dbal/2.10.x.svg?style=flat-square [Coverage 2.10 image]: https://coveralls.io/repos/github/doctrine/dbal/badge.svg?branch=2.10.x
[Quality 2.10 image]: https://img.shields.io/scrutinizer/g/doctrine/dbal/2.10.x.svg?style=flat-square
[ContinuousPHP 2.10 image]: https://img.shields.io/continuousphp/git-hub/doctrine/dbal/2.10.x.svg?style=flat-square [ContinuousPHP 2.10 image]: https://img.shields.io/continuousphp/git-hub/doctrine/dbal/2.10.x.svg?style=flat-square
[2.10]: https://github.com/doctrine/dbal/tree/2.10.x [2.10]: https://github.com/doctrine/dbal/tree/2.10.x
[Scrutinizer 2.10]: https://scrutinizer-ci.com/g/doctrine/dbal/?branch=2.10.x [Coveralls 2.10]: https://coveralls.io/github/doctrine/dbal?branch=2.10.x
[AppVeyor 2.10]: https://ci.appveyor.com/project/doctrine/dbal/branch/2.10.x [AppVeyor 2.10]: https://ci.appveyor.com/project/doctrine/dbal/branch/2.10.x
[AppVeyor 2.10 image]: https://ci.appveyor.com/api/projects/status/i88kitq8qpbm0vie/branch/2.10.x?svg=true [AppVeyor 2.10 image]: https://ci.appveyor.com/api/projects/status/i88kitq8qpbm0vie/branch/2.10.x?svg=true
...@@ -13,19 +13,4 @@ use Doctrine\DBAL\DriverManager; ...@@ -13,19 +13,4 @@ use Doctrine\DBAL\DriverManager;
'password' => 'ORACLE', 'password' => 'ORACLE',
'dbname' => 'XE', 'dbname' => 'XE',
])->query('ALTER USER ORACLE IDENTIFIED BY ORACLE'); ])->query('ALTER USER ORACLE IDENTIFIED BY ORACLE');
$pos = array_search('--coverage-clover', $_SERVER['argv'], true);
if ($pos === false) {
return;
}
$file = $_SERVER['argv'][$pos + 1];
register_shutdown_function(static function () use ($file) : void {
$cmd = 'wget https://github.com/scrutinizer-ci/ocular/releases/download/1.5.2/ocular.phar'
. ' && php ocular.phar code-coverage:upload --format=php-clover ' . escapeshellarg($file);
passthru($cmd);
});
})(); })();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment