From f5daa41bd3c09d3021fde1d7d25a27c88f397c91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amel=20Junuzovi=C4=87?= Date: Sat, 1 Aug 2026 16:12:59 +0200 Subject: [PATCH 1/3] Enable PHPUnit coverage with xdebug, integrate Coveralls for PHP 8.3, and update README badges --- .github/workflows/phpunit.yml | 27 +++++++++++++++++++++++++-- README.md | 5 +++++ phpunit.xml.dist | 11 +++++++++++ 3 files changed, 41 insertions(+), 2 deletions(-) diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index ddfb157..b25675b 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -41,7 +41,7 @@ jobs: php-version: ${{ matrix.php-version }} tools: composer extensions: json, mbstring, xml - coverage: none + coverage: xdebug env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -64,6 +64,29 @@ jobs: fi - name: Test with PHPUnit - run: composer test + run: vendor/bin/phpunit --coverage-text env: TERM: xterm-256color + + - if: matrix.php-version == '8.3' + name: Run Coveralls + continue-on-error: true + run: | + composer global require php-coveralls/php-coveralls + ~/.composer/vendor/bin/php-coveralls --verbose --coverage_clover=build/phpunit/clover.xml --json_path build/phpunit/coveralls-upload.json + env: + COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + COVERALLS_PARALLEL: true + COVERALLS_FLAG_NAME: PHP ${{ matrix.php-version }} + + coveralls: + needs: [main] + name: Coveralls Finished + runs-on: ubuntu-latest + steps: + - name: Upload Coveralls results + uses: coverallsapp/github-action@master + continue-on-error: true + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + parallel-finished: true diff --git a/README.md b/README.md index 03c681d..80d3610 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,10 @@ # CodeIgniter SSE +[![PHPUnit](https://github.com/maniaba/codeigniter4-sse/actions/workflows/phpunit.yml/badge.svg)](https://github.com/maniaba/codeigniter4-sse/actions/workflows/phpunit.yml) +[![PHPStan](https://github.com/maniaba/codeigniter4-sse/actions/workflows/phpstan.yml/badge.svg)](https://github.com/maniaba/codeigniter4-sse/actions/workflows/phpstan.yml) +[![Docs](https://github.com/maniaba/codeigniter4-sse/actions/workflows/docs.yml/badge.svg)](https://github.com/maniaba/codeigniter4-sse/actions/workflows/docs.yml) +[![Coverage Status](https://coveralls.io/repos/github/maniaba/codeigniter4-sse/badge.svg?branch=develop)](https://coveralls.io/github/maniaba/codeigniter4-sse?branch=develop) + [![PHP](https://img.shields.io/badge/PHP-8.2%2B-777BB4.svg)](https://www.php.net/) [![CodeIgniter](https://img.shields.io/badge/CodeIgniter-4.7%2B-DD4814.svg)](https://codeigniter.com/) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE.md) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 2cb2ab3..f07c330 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -9,6 +9,15 @@ executionOrder="random" failOnRisky="true" failOnWarning="true"> + + + + + + + + + tests @@ -20,6 +29,8 @@ + + From 6269d2b0ed3521b82aecd7bff110f3fb2714881e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amel=20Junuzovi=C4=87?= Date: Sat, 1 Aug 2026 16:15:28 +0200 Subject: [PATCH 2/3] Disable coverage reporting in PHPUnit tests --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 4810777..977e7bf 100644 --- a/composer.json +++ b/composer.json @@ -77,7 +77,7 @@ "rector": "rector process --dry-run", "rector-fix": "rector process", "style": "@cs-fix", - "test": "phpunit --configuration=phpunit.xml.dist", + "test": "phpunit --configuration=phpunit.xml.dist --no-coverage", "test-browser": "node --test tests/Browser/*.test.mjs" }, "config": { From eb225b75b6d592d7bdacbc310b3e2ca0ef265d6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amel=20Junuzovi=C4=87?= Date: Sat, 1 Aug 2026 16:18:32 +0200 Subject: [PATCH 3/3] Disable parallel coverage reporting in PHPUnit tests --- .github/workflows/phpunit.yml | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index b25675b..d5b38a9 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -76,17 +76,4 @@ jobs: ~/.composer/vendor/bin/php-coveralls --verbose --coverage_clover=build/phpunit/clover.xml --json_path build/phpunit/coveralls-upload.json env: COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} - COVERALLS_PARALLEL: true COVERALLS_FLAG_NAME: PHP ${{ matrix.php-version }} - - coveralls: - needs: [main] - name: Coveralls Finished - runs-on: ubuntu-latest - steps: - - name: Upload Coveralls results - uses: coverallsapp/github-action@master - continue-on-error: true - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - parallel-finished: true