From d7af2f248b82847361167c89da4ae07820f49cce Mon Sep 17 00:00:00 2001 From: Andrei Pisarevskii Date: Mon, 13 May 2024 15:20:24 +0300 Subject: [PATCH 1/9] Update phpunit.yaml --- .github/workflows/phpunit.yaml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/phpunit.yaml b/.github/workflows/phpunit.yaml index f12a15d..734354a 100644 --- a/.github/workflows/phpunit.yaml +++ b/.github/workflows/phpunit.yaml @@ -38,5 +38,11 @@ jobs: run: | composer install - - name: Run PHPUnit - run: composer run phpunit \ No newline at end of file + + - name: Test & publish code coverage + uses: paambaati/codeclimate-action@v2.6.0 + env: + CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} + with: + coverageCommand: composer run phpunit + debug: true From f4d2ea81639e3c8b762caabb5c1d5c7e394e70dd Mon Sep 17 00:00:00 2001 From: Andrei Pisarevskii Date: Mon, 13 May 2024 15:24:00 +0300 Subject: [PATCH 2/9] Update phpunit.yaml --- .github/workflows/phpunit.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/phpunit.yaml b/.github/workflows/phpunit.yaml index 734354a..a718524 100644 --- a/.github/workflows/phpunit.yaml +++ b/.github/workflows/phpunit.yaml @@ -44,5 +44,4 @@ jobs: env: CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} with: - coverageCommand: composer run phpunit - debug: true + coverageCommand: composer run phpunit -- --coverage-clover From 03191926089e347e53b00d4fb402842b73eee3f6 Mon Sep 17 00:00:00 2001 From: Andrei Pisarevskii Date: Mon, 13 May 2024 15:25:21 +0300 Subject: [PATCH 3/9] Update phpunit.yaml --- .github/workflows/phpunit.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/phpunit.yaml b/.github/workflows/phpunit.yaml index a718524..35e887c 100644 --- a/.github/workflows/phpunit.yaml +++ b/.github/workflows/phpunit.yaml @@ -44,4 +44,4 @@ jobs: env: CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} with: - coverageCommand: composer run phpunit -- --coverage-clover + coverageCommand: ./vendor/bin/phpunit --coverage-clover From 563209bd238556946187939b0d8998d7bd615e4c Mon Sep 17 00:00:00 2001 From: Andrei Pisarevskii Date: Mon, 13 May 2024 15:33:49 +0300 Subject: [PATCH 4/9] coverage fix --- .github/workflows/phpunit.yaml | 2 +- composer.json | 6 +++-- composer.lock | 48 +++++++++++++++++++++++++++++++++- 3 files changed, 52 insertions(+), 4 deletions(-) diff --git a/.github/workflows/phpunit.yaml b/.github/workflows/phpunit.yaml index 35e887c..e45a797 100644 --- a/.github/workflows/phpunit.yaml +++ b/.github/workflows/phpunit.yaml @@ -44,4 +44,4 @@ jobs: env: CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} with: - coverageCommand: ./vendor/bin/phpunit --coverage-clover + coverageCommand: composer run phpunit-coverage diff --git a/composer.json b/composer.json index 08499dd..3298535 100644 --- a/composer.json +++ b/composer.json @@ -34,7 +34,8 @@ "symfony/var-dumper": "^5.4", "phpstan/phpstan": "^1.10", "phpstan/extension-installer": "^1.3", - "phpstan/phpstan-deprecation-rules": "^1.1" + "phpstan/phpstan-deprecation-rules": "^1.1", + "rregeer/phpunit-coverage-check": "^0.3.1" }, "autoload-dev": { "psr-4": { @@ -47,7 +48,8 @@ "phpcbf": "phpcbf --standard=./phpcs.xml", "phpstan": "phpstan analyse -c phpstan.neon", "phpstan.baselane": "phpstan analyse -c phpstan.neon --generate-baseline", - "phpunit": "phpunit" + "phpunit": "phpunit", + "phpunit-coverage": "phpunit --coverage-clover clover.xml" }, "config": { "allow-plugins": { diff --git a/composer.lock b/composer.lock index 7b662b6..db5b0e1 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "0da7a08edb3ee3474c34900c506d9bd0", + "content-hash": "623d8c1ada154ed485262a50cc688861", "packages": [], "packages-dev": [ { @@ -884,6 +884,52 @@ ], "time": "2024-04-05T04:35:58+00:00" }, + { + "name": "rregeer/phpunit-coverage-check", + "version": "0.3.1", + "source": { + "type": "git", + "url": "https://github.com/richardregeer/phpunit-coverage-check.git", + "reference": "9618fa74477fbc448c1b0599bef5153d170094bd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/richardregeer/phpunit-coverage-check/zipball/9618fa74477fbc448c1b0599bef5153d170094bd", + "reference": "9618fa74477fbc448c1b0599bef5153d170094bd", + "shasum": "" + }, + "require": { + "php": ">=7.0.0" + }, + "bin": [ + "bin/coverage-check" + ], + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Richard Regeer", + "email": "rich2309@gmail.com" + } + ], + "description": "Check the code coverage using the clover report of phpunit", + "keywords": [ + "ci", + "code coverage", + "php", + "phpunit", + "testing", + "unittest" + ], + "support": { + "issues": "https://github.com/richardregeer/phpunit-coverage-check/issues", + "source": "https://github.com/richardregeer/phpunit-coverage-check/tree/0.3.1" + }, + "time": "2019-10-14T07:04:13+00:00" + }, { "name": "sebastian/cli-parser", "version": "1.0.2", From fc753fad2bb9bcbcc50648583cc64b1a582b6fa2 Mon Sep 17 00:00:00 2001 From: Andrei Pisarevskii Date: Mon, 13 May 2024 15:36:27 +0300 Subject: [PATCH 5/9] coverage fix --- .github/workflows/phpunit.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/phpunit.yaml b/.github/workflows/phpunit.yaml index e45a797..99837e5 100644 --- a/.github/workflows/phpunit.yaml +++ b/.github/workflows/phpunit.yaml @@ -21,6 +21,7 @@ jobs: with: php-version: ${{ env.PHP_VER }} tools: composer:v${{ env.COMPOSER_VER }} + coverage: pcov - name: Get Composer Cache Directory id: composer-cache From 31d846ae5bc194598e17adcdffd0124167b7f568 Mon Sep 17 00:00:00 2001 From: Andrei Pisarevskii Date: Mon, 13 May 2024 15:38:22 +0300 Subject: [PATCH 6/9] coverage fix --- .github/workflows/phpunit.yaml | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/phpunit.yaml b/.github/workflows/phpunit.yaml index 99837e5..fe0a182 100644 --- a/.github/workflows/phpunit.yaml +++ b/.github/workflows/phpunit.yaml @@ -39,10 +39,17 @@ jobs: run: | composer install + - name: Install Composer packages + run: | + composer run phpunit-coverage - - name: Test & publish code coverage - uses: paambaati/codeclimate-action@v2.6.0 - env: - CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} - with: - coverageCommand: composer run phpunit-coverage + - name: Coverage + run: | + composer run phpunit-coverage +# +# - name: Test & publish code coverage +# uses: paambaati/codeclimate-action@v2.6.0 +# env: +# CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} +# with: +# coverageCommand: composer run phpunit-coverage From 4ca91bdcc53b9a8212c6a16773ffd12d319e2a5d Mon Sep 17 00:00:00 2001 From: Andrei Pisarevskii Date: Mon, 13 May 2024 15:46:53 +0300 Subject: [PATCH 7/9] coverage fix --- .github/workflows/phpunit.yaml | 18 +++++++----------- phpunit.xml | 2 +- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/.github/workflows/phpunit.yaml b/.github/workflows/phpunit.yaml index fe0a182..be723dc 100644 --- a/.github/workflows/phpunit.yaml +++ b/.github/workflows/phpunit.yaml @@ -39,17 +39,13 @@ jobs: run: | composer install - - name: Install Composer packages - run: | - composer run phpunit-coverage - - name: Coverage run: | composer run phpunit-coverage -# -# - name: Test & publish code coverage -# uses: paambaati/codeclimate-action@v2.6.0 -# env: -# CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} -# with: -# coverageCommand: composer run phpunit-coverage + + - name: Test & publish code coverage + uses: paambaati/codeclimate-action@v2.6.0 + env: + CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} + with: + coverageCommand: composer run phpunit-coverage diff --git a/phpunit.xml b/phpunit.xml index 0edb5c7..dd1f1b0 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -8,7 +8,7 @@ "> - / + ./src From b648218f00fac425735ed54ef50ca49673e754a5 Mon Sep 17 00:00:00 2001 From: Andrei Pisarevskii Date: Mon, 13 May 2024 15:48:16 +0300 Subject: [PATCH 8/9] coverage fix --- .github/workflows/phpunit.yaml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/phpunit.yaml b/.github/workflows/phpunit.yaml index be723dc..f635507 100644 --- a/.github/workflows/phpunit.yaml +++ b/.github/workflows/phpunit.yaml @@ -39,11 +39,7 @@ jobs: run: | composer install - - name: Coverage - run: | - composer run phpunit-coverage - - - name: Test & publish code coverage + - name: Tests coverage uses: paambaati/codeclimate-action@v2.6.0 env: CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} From a8e401a03400e580c579a8d522ebab188fa61e7f Mon Sep 17 00:00:00 2001 From: Andrei Pisarevskii Date: Mon, 13 May 2024 15:49:10 +0300 Subject: [PATCH 9/9] coverage fix --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index b57425c..2cf06d3 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ [![UnitTests](https://github.com/renakdup/simple-wordpress-dic/actions/workflows/phpunit.yaml/badge.svg)](https://github.com/renakdup/simple-wordpress-dic/actions/workflows/phpunit.yaml) [![PHPStan](https://github.com/renakdup/simple-wordpress-dic/actions/workflows/phpstan.yaml/badge.svg)](https://github.com/renakdup/simple-wordpress-dic/actions/workflows/phpstan.yaml) [![PHP Version Require](http://poser.pugx.org/renakdup/simple-php-dic/require/php)](https://packagist.org/packages/renakdup/simple-php-dic) +[![Test Coverage](https://api.codeclimate.com/v1/badges/21ae6e3776b160b24e75/test_coverage)](https://codeclimate.com/github/renakdup/simple-php-dic/test_coverage) [![Dependents](http://poser.pugx.org/renakdup/simple-php-dic/dependents)](https://packagist.org/packages/renakdup/simple-php-dic)