From ba57390e6c0be8816686420ff4f7f2a69be507e6 Mon Sep 17 00:00:00 2001 From: Mark Beech Date: Mon, 11 May 2026 19:14:59 +0100 Subject: [PATCH 1/2] Clean up CI: scoped coverage, bump coveralls and php-cs-fixer - test.yml: only install xdebug and upload coverage on the PHP 8.3 job; every other matrix entry runs with `coverage: none`. Cuts wall time significantly without changing what we actually report. - test.yml: bump php-coveralls/php-coveralls from ^1.0 (2018) to ^2.7. - php-cs-fixer.yml: bump actions/checkout to v4 (aligned with test.yml) and oskarstark/php-cs-fixer-ga from 2.18.6 to 3.26.0. - Rename .php_cs.dist to the v3-canonical .php-cs-fixer.dist.php and update the config to v3 syntax (`new PhpCsFixer\Config()`, rule renames). Drops the explicit --config flag since the new filename is auto-discovered. - .gitignore: rename .php_cs.cache to .php-cs-fixer.cache to match v3. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/php-cs-fixer.yml | 6 +++--- .github/workflows/test.yml | 7 ++++--- .gitignore | 2 +- .php_cs.dist => .php-cs-fixer.dist.php | 10 +++++----- 4 files changed, 13 insertions(+), 12 deletions(-) rename .php_cs.dist => .php-cs-fixer.dist.php (78%) diff --git a/.github/workflows/php-cs-fixer.yml b/.github/workflows/php-cs-fixer.yml index d66418a..758446a 100644 --- a/.github/workflows/php-cs-fixer.yml +++ b/.github/workflows/php-cs-fixer.yml @@ -8,14 +8,14 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ github.head_ref }} - name: Run PHP CS Fixer - uses: docker://oskarstark/php-cs-fixer-ga:2.18.6 + uses: docker://oskarstark/php-cs-fixer-ga:3.26.0 with: - args: --config=.php_cs.dist --allow-risky=yes + args: --allow-risky=yes - name: Commit changes uses: stefanzweifel/git-auto-commit-action@v4 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cdd3b74..f7d1a74 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,7 +25,7 @@ jobs: with: php-version: ${{ matrix.php }} tools: composer:v2 - coverage: xdebug + coverage: ${{ matrix.php == '8.3' && 'xdebug' || 'none' }} - name: Get composer cache directory id: composer-cache @@ -46,11 +46,12 @@ jobs: - name: Run Unit tests run: | - vendor/bin/phpunit --coverage-clover=tests/logs/clover.xml + vendor/bin/phpunit ${{ matrix.php == '8.3' && '--coverage-clover=tests/logs/clover.xml' || '' }} - name: Upload coverage results to Coveralls + if: matrix.php == '8.3' env: COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - composer global require php-coveralls/php-coveralls "^1.0" + composer global require php-coveralls/php-coveralls "^2.7" coveralls --coverage_clover=tests/logs/clover.xml -v diff --git a/.gitignore b/.gitignore index 7cf25cb..d2cfcbe 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,7 @@ composer.phar composer.lock .DS_Store .phpunit.result.cache -.php_cs.cache +.php-cs-fixer.cache .coveralls.yml export-ignore .php_cs.dist export-ignore phpunit.xml export-ignore diff --git a/.php_cs.dist b/.php-cs-fixer.dist.php similarity index 78% rename from .php_cs.dist rename to .php-cs-fixer.dist.php index a6442b1..0c28866 100644 --- a/.php_cs.dist +++ b/.php-cs-fixer.dist.php @@ -1,6 +1,6 @@ in([ __DIR__.'/src', __DIR__.'/tests', @@ -9,13 +9,13 @@ ->ignoreDotFiles(true) ->ignoreVCS(true); -return PhpCsFixer\Config::create() +return (new PhpCsFixer\Config()) ->setRules([ '@PSR2' => true, - 'ordered_imports' => ['sortAlgorithm' => 'alpha'], + 'ordered_imports' => ['sort_algorithm' => 'alpha'], 'no_unused_imports' => true, 'not_operator_with_successor_space' => true, - 'trailing_comma_in_multiline_array' => true, + 'trailing_comma_in_multiline' => true, 'phpdoc_scalar' => true, 'unary_operator_spaces' => true, 'binary_operator_spaces' => true, @@ -29,4 +29,4 @@ 'keep_multiple_spaces_after_comma' => true, ], ]) - ->setFinder($finder); \ No newline at end of file + ->setFinder($finder); From e243ddca43f40bc7f81621635e19612ae7fb30a4 Mon Sep 17 00:00:00 2001 From: Mark Beech Date: Mon, 11 May 2026 19:20:52 +0100 Subject: [PATCH 2/2] Rename coveralls call to php-coveralls (v2 binary name) php-coveralls/php-coveralls v2 renamed its bin from `coveralls` to `php-coveralls`, so the previous invocation died with `coveralls: command not found` on the PHP 8.3 coverage job. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f7d1a74..d72df8c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -54,4 +54,4 @@ jobs: COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | composer global require php-coveralls/php-coveralls "^2.7" - coveralls --coverage_clover=tests/logs/clover.xml -v + php-coveralls --coverage_clover=tests/logs/clover.xml -v