From 720694dd89cd3c9af1c21e361393493760d493b1 Mon Sep 17 00:00:00 2001 From: Damien Carrier Date: Fri, 17 Apr 2026 21:46:20 +0200 Subject: [PATCH 1/7] ci: split CI workflow into dedicated lint and tests Separate quality checks (php-cs-fixer, rector, phpstan, composer audit) from test execution to allow independent scheduling and clearer failure signals. Tests workflow now runs a PHP 8.3/8.4/8.5 x Symfony 7.3/7.4/8.0/8.1 matrix to prepare Symfony 8 compatibility. --- .github/workflows/ci.yml | 71 ---------------------------------- .github/workflows/lint.yaml | 67 ++++++++++++++++++++++++++++++++ .github/workflows/tests.yaml | 74 ++++++++++++++++++++++++++++++++++++ 3 files changed, 141 insertions(+), 71 deletions(-) delete mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/lint.yaml create mode 100644 .github/workflows/tests.yaml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 7fb0690..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,71 +0,0 @@ -name: CI - -on: - push: - branches: [ main ] - pull_request: - -jobs: - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - - name: 'Setup PHP' - uses: shivammathur/setup-php@v2 - with: - php-version: '8.3' - - - uses: "ramsey/composer-install@v4" - - - name: PHP CS Fixer - run: ./vendor/bin/php-cs-fixer check - - rector: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - - name: 'Setup PHP' - uses: shivammathur/setup-php@v2 - with: - php-version: '8.3' - - - uses: "ramsey/composer-install@v4" - with: - working-directory: "tools/rector" - - - name: Rector - run: ./tools/bin/rector --dry-run - - test: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - php-version: - - "8.3" - - "8.4" - - steps: - - uses: actions/checkout@v6 - - - name: 'Setup PHP' - uses: shivammathur/setup-php@v2 - with: - php-version: "${{ matrix.php-version }}" - - - uses: "ramsey/composer-install@v4" - with: - composer-options: "--prefer-dist" - - - name: Install PDFtk - run: sudo apt install -y pdftk - - - name: Run tests and collect coverage - run: vendor/bin/phpunit --coverage-clover coverage.xml - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v6 - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 0000000..8e6cf3c --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,67 @@ +name: Lint + +on: + push: + branches: [ main ] + pull_request: + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + + - name: 'Setup PHP' + uses: shivammathur/setup-php@v2 + with: + php-version: 8.3 + + - uses: ramsey/composer-install@v4 + + - name: PHP CS Fixer + run: ./vendor/bin/php-cs-fixer check + + rector: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + + - name: 'Setup PHP' + uses: shivammathur/setup-php@v2 + with: + php-version: 8.3 + + - uses: ramsey/composer-install@v4 + with: + working-directory: "tools/rector" + + - name: Rector + run: ./tools/bin/rector --dry-run + + others: + name: 🧹 Others Quality Checks + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v6 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 8.3 + + - name: Download dependencies + uses: ramsey/composer-install@v4 + + - name: Lint Composer config + shell: bash + run: composer validate + + - name: Check that PSR is respected + shell: bash + run: composer dump-autoload --dev -o --dry-run --strict-psr + + - name: Check whether a PHP dependency is compromised + shell: bash + run: composer audit diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml new file mode 100644 index 0000000..f474a16 --- /dev/null +++ b/.github/workflows/tests.yaml @@ -0,0 +1,74 @@ +name: Tests + +on: + push: + branches: [ main ] + pull_request: + +jobs: + test: + name: "Tests (PHP ${{ matrix.php }})" + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - php: 8.3 + symfony-version: 7.3.* + composer-flags: '--prefer-stable --ignore-platform-req=php+' + - php: 8.3 + symfony-version: 7.4.* + composer-flags: '--prefer-stable --ignore-platform-req=php+' + - php: 8.4 + symfony-version: 7.3.* + composer-flags: '--prefer-stable --ignore-platform-req=php+' + - php: 8.4 + symfony-version: 7.4.* + composer-flags: '--prefer-stable --ignore-platform-req=php+' + - php: 8.4 + symfony-version: 8.0.* + composer-flags: '--prefer-stable --ignore-platform-req=php+' + - php: 8.4 + symfony-version: 8.1.* + composer-flags: '--prefer-stable --ignore-platform-req=php+' + - php: 8.5 + symfony-version: 7.3.* + composer-flags: '--prefer-stable --ignore-platform-req=php+' + - php: 8.5 + symfony-version: 7.4.* + composer-flags: '--prefer-stable --ignore-platform-req=php+' + - php: 8.5 + symfony-version: 8.0.* + composer-flags: '--prefer-stable --ignore-platform-req=php+' + - php: 8.5 + symfony-version: 8.1.* + composer-flags: '--prefer-stable --ignore-platform-req=php+' + steps: + - name: "Checkout" + uses: actions/checkout@v6 + + - name: "Install PHP with extensions" + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + coverage: none + + - name: Configure Composer minimum stability + if: matrix.stability + run: composer config minimum-stability ${{ matrix.stability }} + + - name: Install dependencies + env: + SYMFONY_REQUIRE: ${{ matrix.symfony-version }} + run: composer update ${{ matrix.composer-flags }} --no-interaction --no-progress --optimize-autoloader + + - name: Install PDFtk + run: sudo apt install -y pdftk + + - name: Run tests and collect coverage + run: vendor/bin/phpunit --coverage-clover coverage.xml + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v6 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} From 748816d7b971c07cbd03847517679264009df429 Mon Sep 17 00:00:00 2001 From: Damien Carrier Date: Fri, 17 Apr 2026 21:46:37 +0200 Subject: [PATCH 2/7] chore: relax PHP constraint to support PHP 8.5 Switch from caret to open lower-bound constraint to allow installing on PHP 8.5, which is required for the new test matrix and upcoming Symfony 8 compatibility. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 58977f2..eafca7a 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ } ], "require": { - "php": "^8.3", + "php": ">=8.3", "symfony/process": "^7.2" }, "require-dev": { From 820b1a69c7c3fd1175e9f859a47dbca0805a2d08 Mon Sep 17 00:00:00 2001 From: Damien Carrier Date: Fri, 17 Apr 2026 21:46:43 +0200 Subject: [PATCH 3/7] chore(composer): enable sort-packages config Keep require/require-dev sections alphabetically sorted on each composer update to reduce noise in future dependency diffs. --- .github/workflows/tests.yaml | 6 ++++++ composer.json | 1 + 2 files changed, 7 insertions(+) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index f474a16..09091b5 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -13,12 +13,18 @@ jobs: fail-fast: false matrix: include: + - php: 8.3 + symfony-version: 7.2.* + composer-flags: '--prefer-stable --ignore-platform-req=php+' - php: 8.3 symfony-version: 7.3.* composer-flags: '--prefer-stable --ignore-platform-req=php+' - php: 8.3 symfony-version: 7.4.* composer-flags: '--prefer-stable --ignore-platform-req=php+' + - php: 8.4 + symfony-version: 7.2.* + composer-flags: '--prefer-stable --ignore-platform-req=php+' - php: 8.4 symfony-version: 7.3.* composer-flags: '--prefer-stable --ignore-platform-req=php+' diff --git a/composer.json b/composer.json index eafca7a..20f1f79 100644 --- a/composer.json +++ b/composer.json @@ -31,6 +31,7 @@ "phpstan/phpstan-phpunit": "^2.0" }, "config": { + "sort-packages": true, "allow-plugins": { "phpstan/extension-installer": true } From 47efb3b3f20bf269c031599df6cba036d5756b53 Mon Sep 17 00:00:00 2001 From: Damien Carrier Date: Fri, 17 Apr 2026 22:09:09 +0200 Subject: [PATCH 4/7] chore(deps): allow symfony/process 8.x Widen the constraint from ^7.2 to ^7.2 || ^8.0 so projects migrating to Symfony 8 can install phpdftk. The previous constraint silently capped the CI matrix at symfony/process 7.x even on Sf 8 rows. The library only relies on long-stable Process and ExecutableFinder API (__construct, run, isSuccessful, getOutput, getErrorOutput, getExitCode, find). PHPStan passes against symfony/process 8.0.8. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 20f1f79..9be6833 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ ], "require": { "php": ">=8.3", - "symfony/process": "^7.2" + "symfony/process": "^7.2 || ^8.0" }, "require-dev": { "phpunit/phpunit": "^12", From ca3e48e0ec5456a5be3ca5affc174878bc5a9a8d Mon Sep 17 00:00:00 2001 From: Damien Carrier Date: Mon, 20 Apr 2026 10:42:43 +0200 Subject: [PATCH 5/7] fixup --- .github/workflows/lint.yaml | 2 +- .github/workflows/tests.yaml | 27 ++++++++++++--------------- composer.json | 2 +- 3 files changed, 14 insertions(+), 17 deletions(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 8e6cf3c..1eb572a 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -39,7 +39,7 @@ jobs: run: ./tools/bin/rector --dry-run others: - name: 🧹 Others Quality Checks + name: Others Quality Checks runs-on: ubuntu-latest steps: diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 09091b5..81f7023 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -16,39 +16,40 @@ jobs: - php: 8.3 symfony-version: 7.2.* composer-flags: '--prefer-stable --ignore-platform-req=php+' + stability: stable - php: 8.3 symfony-version: 7.3.* - composer-flags: '--prefer-stable --ignore-platform-req=php+' + composer-flags: '--prefer-stable' - php: 8.3 symfony-version: 7.4.* - composer-flags: '--prefer-stable --ignore-platform-req=php+' + composer-flags: '--prefer-stable' - php: 8.4 symfony-version: 7.2.* - composer-flags: '--prefer-stable --ignore-platform-req=php+' + composer-flags: '--prefer-stable' - php: 8.4 symfony-version: 7.3.* - composer-flags: '--prefer-stable --ignore-platform-req=php+' + composer-flags: '--prefer-stable' - php: 8.4 symfony-version: 7.4.* - composer-flags: '--prefer-stable --ignore-platform-req=php+' + composer-flags: '--prefer-stable' - php: 8.4 symfony-version: 8.0.* - composer-flags: '--prefer-stable --ignore-platform-req=php+' + composer-flags: '--prefer-stable' - php: 8.4 symfony-version: 8.1.* - composer-flags: '--prefer-stable --ignore-platform-req=php+' + composer-flags: '--prefer-stable' - php: 8.5 symfony-version: 7.3.* - composer-flags: '--prefer-stable --ignore-platform-req=php+' + composer-flags: '--prefer-stable' - php: 8.5 symfony-version: 7.4.* - composer-flags: '--prefer-stable --ignore-platform-req=php+' + composer-flags: '--prefer-stable' - php: 8.5 symfony-version: 8.0.* - composer-flags: '--prefer-stable --ignore-platform-req=php+' + composer-flags: '--prefer-stable' - php: 8.5 symfony-version: 8.1.* - composer-flags: '--prefer-stable --ignore-platform-req=php+' + composer-flags: '--prefer-stable' steps: - name: "Checkout" uses: actions/checkout@v6 @@ -59,10 +60,6 @@ jobs: php-version: ${{ matrix.php }} coverage: none - - name: Configure Composer minimum stability - if: matrix.stability - run: composer config minimum-stability ${{ matrix.stability }} - - name: Install dependencies env: SYMFONY_REQUIRE: ${{ matrix.symfony-version }} diff --git a/composer.json b/composer.json index 9be6833..dd96661 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ } ], "require": { - "php": ">=8.3", + "php": "^8.3", "symfony/process": "^7.2 || ^8.0" }, "require-dev": { From 70040fae296b02a0af60896da6f7bad8761d82ad Mon Sep 17 00:00:00 2001 From: Damien Carrier Date: Mon, 20 Apr 2026 11:08:53 +0200 Subject: [PATCH 6/7] Symfony 8.1 note stable release yet --- .github/workflows/tests.yaml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 81f7023..9349cea 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -35,9 +35,6 @@ jobs: - php: 8.4 symfony-version: 8.0.* composer-flags: '--prefer-stable' - - php: 8.4 - symfony-version: 8.1.* - composer-flags: '--prefer-stable' - php: 8.5 symfony-version: 7.3.* composer-flags: '--prefer-stable' @@ -47,9 +44,6 @@ jobs: - php: 8.5 symfony-version: 8.0.* composer-flags: '--prefer-stable' - - php: 8.5 - symfony-version: 8.1.* - composer-flags: '--prefer-stable' steps: - name: "Checkout" uses: actions/checkout@v6 From f800116587d3795eafc317eed8bbe603d706a9a5 Mon Sep 17 00:00:00 2001 From: Damien Carrier Date: Mon, 20 Apr 2026 12:11:32 +0200 Subject: [PATCH 7/7] ci: restore coverage driver for phpunit Drop the explicit 'coverage: none' from setup-php so the default xdebug driver is installed. Without it, 'phpunit --coverage-clover' aborts with "No code coverage driver available" which, combined with failOnWarning=true in phpunit.xml, exits with code 1 before running any test. --- .github/workflows/tests.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 9349cea..22ff078 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -52,7 +52,6 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} - coverage: none - name: Install dependencies env: