From 7378c3e14c9f40bd948e046ca11ba50d40fbf72d Mon Sep 17 00:00:00 2001 From: Christian Scheb Date: Sun, 25 Feb 2024 12:50:25 +0100 Subject: [PATCH] Replace Scrutinizer with Codecov for code coverage --- .gitattributes | 1 - .github/workflows/ci.yaml | 26 +++++++++++++++----------- .scrutinizer.yml | 17 ----------------- README.md | 3 +-- src/analyzer/README.md | 3 +-- src/core/README.md | 3 +-- src/logger/README.md | 3 +-- 7 files changed, 19 insertions(+), 37 deletions(-) delete mode 100644 .scrutinizer.yml diff --git a/.gitattributes b/.gitattributes index 27a14cf..a463eac 100644 --- a/.gitattributes +++ b/.gitattributes @@ -10,7 +10,6 @@ /.gitignore export-ignore /.gitsplit.yml export-ignore /.php_cs.dist export-ignore -/.scrutinizer.yml export-ignore /CONTRIBUTING.md export-ignore /php_cs.xml export-ignore /phpunit.xml.dist export-ignore diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 27a8ead..1a287ba 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -7,8 +7,9 @@ on: jobs: coding-standards: name: 'Coding Standards - PHP ${{ matrix.php-version }}' - runs-on: 'ubuntu-latest' + # We want to run on external PRs, but not on our own internal PRs as they'll be run by the push to the branch. + if: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) }} strategy: fail-fast: false @@ -54,8 +55,9 @@ jobs: tests: name: 'Tests - PHP ${{ matrix.php-version }}' - runs-on: ubuntu-latest + # We want to run on external PRs, but not on our own internal PRs as they'll be run by the push to the branch. + if: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) }} strategy: fail-fast: false @@ -96,8 +98,9 @@ jobs: code-coverage: name: 'Code Coverage - PHP ${{ matrix.php-version }}' - runs-on: 'ubuntu-latest' + # We want to run on external PRs, but not on our own internal PRs as they'll be run by the push to the branch. + if: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) }} strategy: fail-fast: false @@ -112,7 +115,7 @@ jobs: - name: 'Setup PHP' uses: shivammathur/setup-php@v2 with: - coverage: 'none' + coverage: 'pcov' extensions: 'json,dom' php-version: '${{ matrix.php-version }}' @@ -130,11 +133,12 @@ jobs: run: composer show - name: 'Run tests with coverage' - run: phpdbg -qrr vendor/bin/phpunit --coverage-clover coverage/clover.xml + run: vendor/bin/phpunit --coverage-clover coverage/clover.xml - - name: 'Send Coverage' - continue-on-error: true - timeout-minutes: 1 - run: | - wget https://scrutinizer-ci.com/ocular.phar - php ocular.phar code-coverage:upload --format=php-clover coverage/clover.xml + - name: 'Send Coverage to Codecov' + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: coverage/clover.xml + flags: unittests + fail_ci_if_error: true diff --git a/.scrutinizer.yml b/.scrutinizer.yml deleted file mode 100644 index 573ab4a..0000000 --- a/.scrutinizer.yml +++ /dev/null @@ -1,17 +0,0 @@ -filter: - paths: - - src/ - dependency_paths: - - vendor/ -build: - environment: - php: - version: 7.4 - dependencies: - override: - - composer install --ignore-platform-reqs --no-interaction - tests: - override: - - php-scrutinizer-run -tools: - external_code_coverage: true diff --git a/README.md b/README.md index 36aadba..f05a678 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,7 @@ Implements the concept of **tombstones for dead code detection in PHP**. The library provides you with a toolbox to place, track and evaluate tombstones in your code. [![Build Status](https://github.com/scheb/tombstone/workflows/CI/badge.svg?branch=1.x)](https://github.com/scheb/tombstone/actions?query=workflow%3ACI+branch%3A1.x) -[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/scheb/tombstone/badges/quality-score.png?b=1.x)](https://scrutinizer-ci.com/g/scheb/tombstone/?branch=1.x) -[![Code Coverage](https://scrutinizer-ci.com/g/scheb/tombstone/badges/coverage.png?b=1.x)](https://scrutinizer-ci.com/g/scheb/tombstone/?branch=1.x) +[![Code Coverage](https://codecov.io/gh/scheb/tombstone/branch/1.x/graph/badge.svg)](https://app.codecov.io/gh/scheb/tombstone/branch/1.x) [![Latest Stable Version](https://img.shields.io/packagist/v/scheb/tombstone)](https://packagist.org/packages/scheb/tombstone) [![Monthly Downloads](https://img.shields.io/packagist/dm/scheb/tombstone)](https://packagist.org/packages/scheb/tombstone/stats) [![Total Downloads](https://img.shields.io/packagist/dt/scheb/tombstone)](https://packagist.org/packages/scheb/tombstone/stats) diff --git a/src/analyzer/README.md b/src/analyzer/README.md index 137831e..782c6c0 100644 --- a/src/analyzer/README.md +++ b/src/analyzer/README.md @@ -2,8 +2,7 @@ scheb/tombstone-analyzer ======================== [![Build Status](https://github.com/scheb/tombstone/workflows/CI/badge.svg?branch=1.x)](https://github.com/scheb/tombstone/actions?query=workflow%3ACI+branch%3A1.x) -[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/scheb/tombstone/badges/quality-score.png?b=1.x)](https://scrutinizer-ci.com/g/scheb/tombstone/?branch=1.x) -[![Code Coverage](https://scrutinizer-ci.com/g/scheb/tombstone/badges/coverage.png?b=1.x)](https://scrutinizer-ci.com/g/scheb/tombstone/?branch=1.x) +[![Code Coverage](https://codecov.io/gh/scheb/tombstone/branch/1.x/graph/badge.svg)](https://app.codecov.io/gh/scheb/tombstone/branch/1.x) [![Latest Stable Version](https://img.shields.io/packagist/v/scheb/tombstone-analyzer)](https://packagist.org/packages/scheb/tombstone-analyzer) [![Monthly Downloads](https://img.shields.io/packagist/dm/scheb/tombstone-analyzer)](https://packagist.org/packages/scheb/tombstone-analyzer/stats) [![Total Downloads](https://img.shields.io/packagist/dt/scheb/tombstone-analyzer)](https://packagist.org/packages/scheb/tombstone-analyzer/stats) diff --git a/src/core/README.md b/src/core/README.md index 47d1fac..adf82bb 100644 --- a/src/core/README.md +++ b/src/core/README.md @@ -2,8 +2,7 @@ scheb/tombstone-core ==================== [![Build Status](https://github.com/scheb/tombstone/workflows/CI/badge.svg?branch=1.x)](https://github.com/scheb/tombstone/actions?query=workflow%3ACI+branch%3A1.x) -[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/scheb/tombstone/badges/quality-score.png?b=1.x)](https://scrutinizer-ci.com/g/scheb/tombstone/?branch=1.x) -[![Code Coverage](https://scrutinizer-ci.com/g/scheb/tombstone/badges/coverage.png?b=1.x)](https://scrutinizer-ci.com/g/scheb/tombstone/?branch=1.x) +[![Code Coverage](https://codecov.io/gh/scheb/tombstone/branch/1.x/graph/badge.svg)](https://app.codecov.io/gh/scheb/tombstone/branch/1.x) [![Latest Stable Version](https://img.shields.io/packagist/v/scheb/tombstone-core)](https://packagist.org/packages/scheb/tombstone-core) [![Monthly Downloads](https://img.shields.io/packagist/dm/scheb/tombstone-core)](https://packagist.org/packages/scheb/tombstone-core/stats) [![Total Downloads](https://img.shields.io/packagist/dt/scheb/tombstone-core)](https://packagist.org/packages/scheb/tombstone-core/stats) diff --git a/src/logger/README.md b/src/logger/README.md index 6205619..348de34 100644 --- a/src/logger/README.md +++ b/src/logger/README.md @@ -2,8 +2,7 @@ scheb/tombstone-logger ====================== [![Build Status](https://github.com/scheb/tombstone/workflows/CI/badge.svg?branch=1.x)](https://github.com/scheb/tombstone/actions?query=workflow%3ACI+branch%3A1.x) -[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/scheb/tombstone/badges/quality-score.png?b=1.x)](https://scrutinizer-ci.com/g/scheb/tombstone/?branch=1.x) -[![Code Coverage](https://scrutinizer-ci.com/g/scheb/tombstone/badges/coverage.png?b=1.x)](https://scrutinizer-ci.com/g/scheb/tombstone/?branch=1.x) +[![Code Coverage](https://codecov.io/gh/scheb/tombstone/branch/1.x/graph/badge.svg)](https://app.codecov.io/gh/scheb/tombstone/branch/1.x) [![Latest Stable Version](https://img.shields.io/packagist/v/scheb/tombstone-logger)](https://packagist.org/packages/scheb/tombstone-logger) [![Monthly Downloads](https://img.shields.io/packagist/dm/scheb/tombstone-logger)](https://packagist.org/packages/scheb/tombstone-logger/stats) [![Total Downloads](https://img.shields.io/packagist/dt/scheb/tombstone-logger)](https://packagist.org/packages/scheb/tombstone-logger/stats)