From c110e79f0c3680e4867a3406a398f30c0bca69db Mon Sep 17 00:00:00 2001 From: Yoanm <4410697+yoanm@users.noreply.github.com> Date: Tue, 2 Sep 2025 23:36:50 +0200 Subject: [PATCH 01/14] [BC] Add sf 7.0 and drop 4.4 --- .github/workflows/reusable-CI-workflow.yml | 10 +++++----- .github/workflows/supported-versions.json | 2 +- composer.json | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/reusable-CI-workflow.yml b/.github/workflows/reusable-CI-workflow.yml index e5faa32..88de2ab 100644 --- a/.github/workflows/reusable-CI-workflow.yml +++ b/.github/workflows/reusable-CI-workflow.yml @@ -62,21 +62,21 @@ jobs: symfony-version: '${{ needs.fetch-supported-versions.outputs.symfony-max }}' # Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317) pkg-extra-constraints: behat/gherkin:~4.12.0 - - job-name: Up to date versions - Special case - Symfony 5.4 + - job-name: Up to date versions - Special case - Symfony 6.4 php-version: '${{ needs.fetch-supported-versions.outputs.php-max }}' - symfony-version: '5.4' + symfony-version: '6.4' # Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317) # Fix - symfony/yaml - Avoid issue with Sf YAML 6.4+ and Framework bundle pkg-extra-constraints: behat/gherkin:~4.12.0 ${{ ( needs.fetch-supported-versions.outputs.symfony-max == '6.4' ) && 'symfony/yaml:~6.4.0' || '' }} - job-name: Bare minimum # => Lowest versions allowed by composer config php-version: '${{ needs.fetch-supported-versions.outputs.php-min }}' symfony-version: '${{ needs.fetch-supported-versions.outputs.symfony-min }}' - - job-name: Bare minimum - Special case - Symfony 5.4 + - job-name: Bare minimum - Special case - Symfony 6.4 php-version: '${{ needs.fetch-supported-versions.outputs.php-min }}' - symfony-version: '5.4' + symfony-version: '6.4' - job-name: Late migration - PHP # => Highest symfony version with lowest php version allowed by composer config # Fix - Sf 6.4 require php 8.1 minimum ! - php-version: ${{ ( needs.fetch-supported-versions.outputs.symfony-max == '6.4' && needs.fetch-supported-versions.outputs.php-min == '8.0' ) && '8.1' || needs.fetch-supported-versions.outputs.php-min }} + php-version: ${{ ( needs.fetch-supported-versions.outputs.symfony-max == '7.0' && needs.fetch-supported-versions.outputs.php-min == '8.0' ) && '8.1' || needs.fetch-supported-versions.outputs.php-min }} symfony-version: '${{ needs.fetch-supported-versions.outputs.symfony-max }}' - job-name: Late migration - Symfony # => Lowest symfony version with highest php version allowed by composer config php-version: '${{ needs.fetch-supported-versions.outputs.php-max }}' diff --git a/.github/workflows/supported-versions.json b/.github/workflows/supported-versions.json index 9a11141..fefdd3a 100644 --- a/.github/workflows/supported-versions.json +++ b/.github/workflows/supported-versions.json @@ -1,4 +1,4 @@ { "php": {"min": "8.0", "max": "8.4", "next": "8.5"}, - "symfony": {"min": "4.4", "max": "6.4", "next": "7.0"} + "symfony": {"min": "5.4", "max": "7.0", "next": "7.1"} } diff --git a/composer.json b/composer.json index 99b797e..3d0a62e 100644 --- a/composer.json +++ b/composer.json @@ -32,7 +32,7 @@ }, "require": { "php": "^8.0", - "symfony/validator": "^4.4 || ^5.4 || ^6.0", + "symfony/validator": "^5.4 || ^6.4 || ^7.0", "yoanm/jsonrpc-server-sdk": "^3.0" }, "require-dev": { From 309f60a280ab10a2c07196d5226956ce509d7337 Mon Sep 17 00:00:00 2001 From: Yoanm <4410697+yoanm@users.noreply.github.com> Date: Tue, 2 Sep 2025 23:39:51 +0200 Subject: [PATCH 02/14] Fix --- .github/workflows/reusable-CI-workflow.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/reusable-CI-workflow.yml b/.github/workflows/reusable-CI-workflow.yml index 88de2ab..2b02429 100644 --- a/.github/workflows/reusable-CI-workflow.yml +++ b/.github/workflows/reusable-CI-workflow.yml @@ -72,11 +72,12 @@ jobs: php-version: '${{ needs.fetch-supported-versions.outputs.php-min }}' symfony-version: '${{ needs.fetch-supported-versions.outputs.symfony-min }}' - job-name: Bare minimum - Special case - Symfony 6.4 - php-version: '${{ needs.fetch-supported-versions.outputs.php-min }}' + # Fix - Sf 6.4 require php 8.1 minimum ! + php-version: ${{ ( needs.fetch-supported-versions.outputs.php-min == '8.0' ) && '8.1' || needs.fetch-supported-versions.outputs.php-min }} symfony-version: '6.4' - job-name: Late migration - PHP # => Highest symfony version with lowest php version allowed by composer config - # Fix - Sf 6.4 require php 8.1 minimum ! - php-version: ${{ ( needs.fetch-supported-versions.outputs.symfony-max == '7.0' && needs.fetch-supported-versions.outputs.php-min == '8.0' ) && '8.1' || needs.fetch-supported-versions.outputs.php-min }} + # Fix - Sf 7.0 require php 8.1 minimum, most of deps require 8.2 ! + php-version: ${{ ( needs.fetch-supported-versions.outputs.symfony-max == '7.0' && needs.fetch-supported-versions.outputs.php-min == '8.0' ) && '8.2' || needs.fetch-supported-versions.outputs.php-min }} symfony-version: '${{ needs.fetch-supported-versions.outputs.symfony-max }}' - job-name: Late migration - Symfony # => Lowest symfony version with highest php version allowed by composer config php-version: '${{ needs.fetch-supported-versions.outputs.php-max }}' From e690b79794dfc44ceb528449b395626c475879d6 Mon Sep 17 00:00:00 2001 From: Yoanm <4410697+yoanm@users.noreply.github.com> Date: Tue, 2 Sep 2025 23:52:16 +0200 Subject: [PATCH 03/14] Fix --- .github/workflows/reusable-CI-workflow.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/reusable-CI-workflow.yml b/.github/workflows/reusable-CI-workflow.yml index 2b02429..172ee1d 100644 --- a/.github/workflows/reusable-CI-workflow.yml +++ b/.github/workflows/reusable-CI-workflow.yml @@ -66,8 +66,7 @@ jobs: php-version: '${{ needs.fetch-supported-versions.outputs.php-max }}' symfony-version: '6.4' # Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317) - # Fix - symfony/yaml - Avoid issue with Sf YAML 6.4+ and Framework bundle - pkg-extra-constraints: behat/gherkin:~4.12.0 ${{ ( needs.fetch-supported-versions.outputs.symfony-max == '6.4' ) && 'symfony/yaml:~6.4.0' || '' }} + pkg-extra-constraints: behat/gherkin:~4.12.0 - job-name: Bare minimum # => Lowest versions allowed by composer config php-version: '${{ needs.fetch-supported-versions.outputs.php-min }}' symfony-version: '${{ needs.fetch-supported-versions.outputs.symfony-min }}' @@ -243,14 +242,14 @@ jobs: symfony-version: ${{ needs.fetch-supported-versions.outputs.symfony-next }} # Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317) # Fix - symfony/framework-bundle - Framework bundle <7.0 require php 8.1 minimum ! - pkg-extra-constraints: behat/gherkin:~4.12.0 ${{ ( needs.fetch-supported-versions.outputs.symfony-next == '7.0' && needs.fetch-supported-versions.outputs.php-max == '8.4' ) && 'symfony/framework-bundle:~7.0.0@dev' || '' }} + pkg-extra-constraints: behat/gherkin:~4.12.0 - job-name: Symfony - With lowest supported PHP version - # Fix - Sf 7.0 require php 8.1 minimum, most of deps require 8.2 ! - php-version: ${{ ( needs.fetch-supported-versions.outputs.symfony-next == '7.0' && needs.fetch-supported-versions.outputs.php-min == '8.0' ) && '8.2' || needs.fetch-supported-versions.outputs.php-min }} + # Fix - symfony/validator 7.1 require php 8.2 minimum ! + php-version: ${{ ( needs.fetch-supported-versions.outputs.symfony-next == '7.1' && needs.fetch-supported-versions.outputs.php-min == '8.0' ) && '8.2' || needs.fetch-supported-versions.outputs.php-min }} symfony-version: ${{ needs.fetch-supported-versions.outputs.symfony-next }} # Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317) # Fix - symfony/framework-bundle - Framework bundle <7.0 require php 8.1 minimum ! - pkg-extra-constraints: behat/gherkin:~4.12.0 ${{ ( needs.fetch-supported-versions.outputs.symfony-next == '7.0' && needs.fetch-supported-versions.outputs.php-min == '8.0' ) && 'symfony/framework-bundle:~7.0.0@dev' || '' }} + pkg-extra-constraints: behat/gherkin:~4.12.0 steps: - name: Check out code From b887512cb5612bdd7168dd4574faa52abbe967ff Mon Sep 17 00:00:00 2001 From: Yoanm <4410697+yoanm@users.noreply.github.com> Date: Wed, 3 Sep 2025 08:39:30 +0200 Subject: [PATCH 04/14] Improve --- .github/workflows/CI.yml | 12 +++++++++++ ...erge-dependabot.yml => dependabot-PRs.yml} | 2 +- .github/workflows/reusable-CI-workflow.yml | 20 +++++++++---------- 3 files changed, 23 insertions(+), 11 deletions(-) rename .github/workflows/{auto-merge-dependabot.yml => dependabot-PRs.yml} (98%) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index b262c39..454e83f 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -7,11 +7,23 @@ on: # Build any PRs and main branch changes - opened - synchronize paths-ignore: + # >>> CI Pre-check # In case of updates to those workflows, they must be pre-checked by `pre-check-CI-updates.yml` rather than this workflow ! # Any updates on those workflows are expected to be restricted to those workflows only ! (no update on code for instance) - '.github/workflows/pre-check-CI-updates.yml' - '.github/workflows/reusable-CI-workflow.yml' - '.github/workflows/reusable-coverage-upload-workflow.yml' + # <<< CI Pre-check + # >>> Irrelevant files (no impact whatsoever on this GHWorkflow) + - '.github/workflows/coverage-upload.yml' # Executed for on master (workflow_run), no impact here + - '.github/workflows/dependabot-PRs.yml' # Executed for dependabot PRs, no impact here + - '**/*.md' + - '**/LICENSE' + - '**/CODEOWNERS' + - '**/.remarkrc*' + - '**/.editorconfig' + - '**/.scrutinizer.yml' + # <<< Irrelevant files push: branches: [ master ] schedule: diff --git a/.github/workflows/auto-merge-dependabot.yml b/.github/workflows/dependabot-PRs.yml similarity index 98% rename from .github/workflows/auto-merge-dependabot.yml rename to .github/workflows/dependabot-PRs.yml index 39d0feb..3f45522 100644 --- a/.github/workflows/auto-merge-dependabot.yml +++ b/.github/workflows/dependabot-PRs.yml @@ -1,4 +1,4 @@ -name: PR auto-merge +name: Dependabot PRs on: pull_request permissions: diff --git a/.github/workflows/reusable-CI-workflow.yml b/.github/workflows/reusable-CI-workflow.yml index 172ee1d..2a7c80d 100644 --- a/.github/workflows/reusable-CI-workflow.yml +++ b/.github/workflows/reusable-CI-workflow.yml @@ -45,7 +45,7 @@ jobs: dependency: symfony tests: - name: ${{ matrix.job-name }} + name: PHP ${{ matrix.php-version }} & Sf ${{ matrix.symfony-version }} - ${{ matrix.job-name }} needs: [fetch-supported-versions] runs-on: ubuntu-latest permissions: @@ -62,7 +62,7 @@ jobs: symfony-version: '${{ needs.fetch-supported-versions.outputs.symfony-max }}' # Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317) pkg-extra-constraints: behat/gherkin:~4.12.0 - - job-name: Up to date versions - Special case - Symfony 6.4 + - job-name: Up to date versions - Sf 6.4 case php-version: '${{ needs.fetch-supported-versions.outputs.php-max }}' symfony-version: '6.4' # Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317) @@ -70,15 +70,15 @@ jobs: - job-name: Bare minimum # => Lowest versions allowed by composer config php-version: '${{ needs.fetch-supported-versions.outputs.php-min }}' symfony-version: '${{ needs.fetch-supported-versions.outputs.symfony-min }}' - - job-name: Bare minimum - Special case - Symfony 6.4 + - job-name: Bare minimum - Sf 6.4 case # Fix - Sf 6.4 require php 8.1 minimum ! php-version: ${{ ( needs.fetch-supported-versions.outputs.php-min == '8.0' ) && '8.1' || needs.fetch-supported-versions.outputs.php-min }} symfony-version: '6.4' - - job-name: Late migration - PHP # => Highest symfony version with lowest php version allowed by composer config + - job-name: Late PHP migration # => Highest symfony version with lowest php version allowed by composer config # Fix - Sf 7.0 require php 8.1 minimum, most of deps require 8.2 ! php-version: ${{ ( needs.fetch-supported-versions.outputs.symfony-max == '7.0' && needs.fetch-supported-versions.outputs.php-min == '8.0' ) && '8.2' || needs.fetch-supported-versions.outputs.php-min }} symfony-version: '${{ needs.fetch-supported-versions.outputs.symfony-max }}' - - job-name: Late migration - Symfony # => Lowest symfony version with highest php version allowed by composer config + - job-name: Late Symfony migration # => Lowest symfony version with highest php version allowed by composer config php-version: '${{ needs.fetch-supported-versions.outputs.php-max }}' symfony-version: '${{ needs.fetch-supported-versions.outputs.symfony-min }}' # Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317) @@ -214,7 +214,7 @@ jobs: uses: actions/dependency-review-action@v4 nightly-tests: - name: Nightly - ${{ matrix.job-name }} + name: Nightly - PHP ${{ matrix.php-version }} & Sf ${{ matrix.symfony-version }} - ${{ matrix.job-name }} needs: [ fetch-supported-versions, tests ] if: ${{ github.event_name == 'push' || ( github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'with-nightly-tests') ) }} runs-on: ubuntu-latest @@ -227,23 +227,23 @@ jobs: fail-fast: false matrix: include: - - job-name: PHP - With highest supported Symfony versions + - job-name: PHP with highest supported Symfony versions php-version: ${{ needs.fetch-supported-versions.outputs.php-next }} symfony-version: ${{ needs.fetch-supported-versions.outputs.symfony-max }} # Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317) pkg-extra-constraints: behat/gherkin:~4.12.0 - - job-name: PHP - With lowest supported Symfony versions + - job-name: PHP with lowest supported Symfony versions php-version: ${{ needs.fetch-supported-versions.outputs.php-next }} symfony-version: ${{ needs.fetch-supported-versions.outputs.symfony-min }} # Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317) pkg-extra-constraints: behat/gherkin:~4.12.0 - - job-name: Symfony - With highest supported PHP version + - job-name: Symfony with highest supported PHP version php-version: ${{ needs.fetch-supported-versions.outputs.php-max }} symfony-version: ${{ needs.fetch-supported-versions.outputs.symfony-next }} # Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317) # Fix - symfony/framework-bundle - Framework bundle <7.0 require php 8.1 minimum ! pkg-extra-constraints: behat/gherkin:~4.12.0 - - job-name: Symfony - With lowest supported PHP version + - job-name: Symfony with lowest supported PHP version # Fix - symfony/validator 7.1 require php 8.2 minimum ! php-version: ${{ ( needs.fetch-supported-versions.outputs.symfony-next == '7.1' && needs.fetch-supported-versions.outputs.php-min == '8.0' ) && '8.2' || needs.fetch-supported-versions.outputs.php-min }} symfony-version: ${{ needs.fetch-supported-versions.outputs.symfony-next }} From 1218e5907155db07234bfaadc83bc0fd2c578de9 Mon Sep 17 00:00:00 2001 From: Yoanm <4410697+yoanm@users.noreply.github.com> Date: Wed, 3 Sep 2025 09:00:43 +0200 Subject: [PATCH 05/14] Improve --- .github/workflows/reusable-CI-workflow.yml | 26 +++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/reusable-CI-workflow.yml b/.github/workflows/reusable-CI-workflow.yml index 2a7c80d..22aa8e8 100644 --- a/.github/workflows/reusable-CI-workflow.yml +++ b/.github/workflows/reusable-CI-workflow.yml @@ -61,12 +61,12 @@ jobs: php-version: '${{ needs.fetch-supported-versions.outputs.php-max }}' symfony-version: '${{ needs.fetch-supported-versions.outputs.symfony-max }}' # Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317) - pkg-extra-constraints: behat/gherkin:~4.12.0 + pkg-extra-constraints: --with 'behat/gherkin:~4.12.0' - job-name: Up to date versions - Sf 6.4 case php-version: '${{ needs.fetch-supported-versions.outputs.php-max }}' symfony-version: '6.4' # Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317) - pkg-extra-constraints: behat/gherkin:~4.12.0 + pkg-extra-constraints: --with 'behat/gherkin:~4.12.0' - job-name: Bare minimum # => Lowest versions allowed by composer config php-version: '${{ needs.fetch-supported-versions.outputs.php-min }}' symfony-version: '${{ needs.fetch-supported-versions.outputs.symfony-min }}' @@ -82,7 +82,7 @@ jobs: php-version: '${{ needs.fetch-supported-versions.outputs.php-max }}' symfony-version: '${{ needs.fetch-supported-versions.outputs.symfony-min }}' # Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317) - pkg-extra-constraints: behat/gherkin:~4.12.0 + pkg-extra-constraints: --with 'behat/gherkin:~4.12.0' steps: - name: Check out code uses: actions/checkout@v5 @@ -120,8 +120,8 @@ jobs: - name: Build with PHP ${{ steps.setup-php.outputs.php-version }} & Symfony ${{ matrix.symfony-version }} run: | SF_CONSTRAINT="~${{ matrix.symfony-version }}.0" - composer require -W \ - symfony/validator:${SF_CONSTRAINT} \ + composer update --no-install --with-all-dependencies --minimal-changes \ + --with "symfony/validator:${SF_CONSTRAINT}" \ ${{ matrix.pkg-extra-constraints }} \ && make build @@ -202,8 +202,8 @@ jobs: - name: Build with PHP ${{ steps.setup-php.outputs.php-version }} & Symfony ${{ env.SYMFONY_VERSION }} run: | SF_CONSTRAINT="~${{ env.SYMFONY_VERSION }}.0" - composer require -W \ - symfony/validator:${SF_CONSTRAINT} \ + composer update --no-install --with-all-dependencies --minimal-changes \ + --with "symfony/validator:${SF_CONSTRAINT}" \ && make build - name: ComposerRequireChecker @@ -231,25 +231,25 @@ jobs: php-version: ${{ needs.fetch-supported-versions.outputs.php-next }} symfony-version: ${{ needs.fetch-supported-versions.outputs.symfony-max }} # Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317) - pkg-extra-constraints: behat/gherkin:~4.12.0 + pkg-extra-constraints: --with 'behat/gherkin:~4.12.0' - job-name: PHP with lowest supported Symfony versions php-version: ${{ needs.fetch-supported-versions.outputs.php-next }} symfony-version: ${{ needs.fetch-supported-versions.outputs.symfony-min }} # Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317) - pkg-extra-constraints: behat/gherkin:~4.12.0 + pkg-extra-constraints: --with 'behat/gherkin:~4.12.0' - job-name: Symfony with highest supported PHP version php-version: ${{ needs.fetch-supported-versions.outputs.php-max }} symfony-version: ${{ needs.fetch-supported-versions.outputs.symfony-next }} # Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317) # Fix - symfony/framework-bundle - Framework bundle <7.0 require php 8.1 minimum ! - pkg-extra-constraints: behat/gherkin:~4.12.0 + pkg-extra-constraints: --with 'behat/gherkin:~4.12.0' - job-name: Symfony with lowest supported PHP version # Fix - symfony/validator 7.1 require php 8.2 minimum ! php-version: ${{ ( needs.fetch-supported-versions.outputs.symfony-next == '7.1' && needs.fetch-supported-versions.outputs.php-min == '8.0' ) && '8.2' || needs.fetch-supported-versions.outputs.php-min }} symfony-version: ${{ needs.fetch-supported-versions.outputs.symfony-next }} # Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317) # Fix - symfony/framework-bundle - Framework bundle <7.0 require php 8.1 minimum ! - pkg-extra-constraints: behat/gherkin:~4.12.0 + pkg-extra-constraints: --with 'behat/gherkin:~4.12.0' steps: - name: Check out code @@ -282,8 +282,8 @@ jobs: run: | SF_CONSTRAINT="~${{ matrix.symfony-version }}.0@dev" composer config minimum-stability dev \ - && composer require -W \ - symfony/validator:${SF_CONSTRAINT} \ + && composer update --no-install --with-all-dependencies --minimal-changes \ + --with "symfony/validator:${SF_CONSTRAINT}" \ ${{ matrix.pkg-extra-constraints }} \ && make build From e8bdf870679fccfca5efd1ad5fee36208a517116 Mon Sep 17 00:00:00 2001 From: Yoanm <4410697+yoanm@users.noreply.github.com> Date: Wed, 3 Sep 2025 09:20:32 +0200 Subject: [PATCH 06/14] Polish --- .github/workflows/reusable-CI-workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reusable-CI-workflow.yml b/.github/workflows/reusable-CI-workflow.yml index 22aa8e8..ec30b04 100644 --- a/.github/workflows/reusable-CI-workflow.yml +++ b/.github/workflows/reusable-CI-workflow.yml @@ -283,7 +283,7 @@ jobs: SF_CONSTRAINT="~${{ matrix.symfony-version }}.0@dev" composer config minimum-stability dev \ && composer update --no-install --with-all-dependencies --minimal-changes \ - --with "symfony/validator:${SF_CONSTRAINT}" \ + --with "symfony/validator:${SF_CONSTRAINT}" \ ${{ matrix.pkg-extra-constraints }} \ && make build From 243c4e1666e36f9d2b3ed7dd6fa49d1580d4ff1d Mon Sep 17 00:00:00 2001 From: Yoanm <4410697+yoanm@users.noreply.github.com> Date: Wed, 3 Sep 2025 09:23:44 +0200 Subject: [PATCH 07/14] Trigger CI From 363d2650152c79445ac16935939c7ba47be9d25f Mon Sep 17 00:00:00 2001 From: Yoanm <4410697+yoanm@users.noreply.github.com> Date: Wed, 3 Sep 2025 10:17:54 +0200 Subject: [PATCH 08/14] Harmonize CI --- .github/workflows/CI.yml | 12 +++++ ...erge-dependabot.yml => dependabot-PRs.yml} | 5 +- .github/workflows/reusable-CI-workflow.yml | 46 +++++++++++-------- 3 files changed, 42 insertions(+), 21 deletions(-) rename .github/workflows/{auto-merge-dependabot.yml => dependabot-PRs.yml} (95%) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index b262c39..454e83f 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -7,11 +7,23 @@ on: # Build any PRs and main branch changes - opened - synchronize paths-ignore: + # >>> CI Pre-check # In case of updates to those workflows, they must be pre-checked by `pre-check-CI-updates.yml` rather than this workflow ! # Any updates on those workflows are expected to be restricted to those workflows only ! (no update on code for instance) - '.github/workflows/pre-check-CI-updates.yml' - '.github/workflows/reusable-CI-workflow.yml' - '.github/workflows/reusable-coverage-upload-workflow.yml' + # <<< CI Pre-check + # >>> Irrelevant files (no impact whatsoever on this GHWorkflow) + - '.github/workflows/coverage-upload.yml' # Executed for on master (workflow_run), no impact here + - '.github/workflows/dependabot-PRs.yml' # Executed for dependabot PRs, no impact here + - '**/*.md' + - '**/LICENSE' + - '**/CODEOWNERS' + - '**/.remarkrc*' + - '**/.editorconfig' + - '**/.scrutinizer.yml' + # <<< Irrelevant files push: branches: [ master ] schedule: diff --git a/.github/workflows/auto-merge-dependabot.yml b/.github/workflows/dependabot-PRs.yml similarity index 95% rename from .github/workflows/auto-merge-dependabot.yml rename to .github/workflows/dependabot-PRs.yml index 39d0feb..d803072 100644 --- a/.github/workflows/auto-merge-dependabot.yml +++ b/.github/workflows/dependabot-PRs.yml @@ -1,4 +1,4 @@ -name: PR auto-merge +name: Dependabot PRs on: pull_request permissions: @@ -7,11 +7,12 @@ permissions: jobs: dependabot: + name: Auto-merge & Labels + if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'yoanm/php-jsonrpc-params-symfony-validator-sdk' runs-on: ubuntu-latest permissions: contents: write pull-requests: write - if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'yoanm/php-jsonrpc-params-symfony-validator-sdk' steps: - name: Dependabot metadata id: metadata diff --git a/.github/workflows/reusable-CI-workflow.yml b/.github/workflows/reusable-CI-workflow.yml index e5faa32..30960d8 100644 --- a/.github/workflows/reusable-CI-workflow.yml +++ b/.github/workflows/reusable-CI-workflow.yml @@ -45,7 +45,7 @@ jobs: dependency: symfony tests: - name: ${{ matrix.job-name }} + name: PHP ${{ matrix.php-version }} & Sf ${{ matrix.symfony-version }} - ${{ matrix.job-name }} needs: [fetch-supported-versions] runs-on: ubuntu-latest permissions: @@ -61,28 +61,28 @@ jobs: php-version: '${{ needs.fetch-supported-versions.outputs.php-max }}' symfony-version: '${{ needs.fetch-supported-versions.outputs.symfony-max }}' # Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317) - pkg-extra-constraints: behat/gherkin:~4.12.0 - - job-name: Up to date versions - Special case - Symfony 5.4 + pkg-extra-constraints: --with 'behat/gherkin:~4.12.0' + - job-name: Up to date versions - Sf 5.4 case php-version: '${{ needs.fetch-supported-versions.outputs.php-max }}' symfony-version: '5.4' # Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317) # Fix - symfony/yaml - Avoid issue with Sf YAML 6.4+ and Framework bundle - pkg-extra-constraints: behat/gherkin:~4.12.0 ${{ ( needs.fetch-supported-versions.outputs.symfony-max == '6.4' ) && 'symfony/yaml:~6.4.0' || '' }} + pkg-extra-constraints: --with 'behat/gherkin:~4.12.0' ${{ ( needs.fetch-supported-versions.outputs.symfony-max == '6.4' ) && '--with "symfony/yaml:~6.4.0"' || '' }} - job-name: Bare minimum # => Lowest versions allowed by composer config php-version: '${{ needs.fetch-supported-versions.outputs.php-min }}' symfony-version: '${{ needs.fetch-supported-versions.outputs.symfony-min }}' - - job-name: Bare minimum - Special case - Symfony 5.4 + - job-name: Bare minimum - Sf 5.4 case php-version: '${{ needs.fetch-supported-versions.outputs.php-min }}' symfony-version: '5.4' - - job-name: Late migration - PHP # => Highest symfony version with lowest php version allowed by composer config + - job-name: Late PHP migration # => Highest symfony version with lowest php version allowed by composer config # Fix - Sf 6.4 require php 8.1 minimum ! php-version: ${{ ( needs.fetch-supported-versions.outputs.symfony-max == '6.4' && needs.fetch-supported-versions.outputs.php-min == '8.0' ) && '8.1' || needs.fetch-supported-versions.outputs.php-min }} symfony-version: '${{ needs.fetch-supported-versions.outputs.symfony-max }}' - - job-name: Late migration - Symfony # => Lowest symfony version with highest php version allowed by composer config + - job-name: Late Symfony migration # => Lowest symfony version with highest php version allowed by composer config php-version: '${{ needs.fetch-supported-versions.outputs.php-max }}' symfony-version: '${{ needs.fetch-supported-versions.outputs.symfony-min }}' # Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317) - pkg-extra-constraints: behat/gherkin:~4.12.0 + pkg-extra-constraints: --with 'behat/gherkin:~4.12.0' steps: - name: Check out code uses: actions/checkout@v5 @@ -119,9 +119,12 @@ jobs: - name: Build with PHP ${{ steps.setup-php.outputs.php-version }} & Symfony ${{ matrix.symfony-version }} run: | + # Rely on "composer update --with" rather than "composer require" ! + # => it ensures the tested version is actually allowed by constraints + # ("composer require" would override those constraints, which may not produce something actually installable by end-user) SF_CONSTRAINT="~${{ matrix.symfony-version }}.0" - composer require -W \ - symfony/validator:${SF_CONSTRAINT} \ + composer update --no-install --with-all-dependencies --minimal-changes \ + --with "symfony/validator:${SF_CONSTRAINT}" \ ${{ matrix.pkg-extra-constraints }} \ && make build @@ -201,9 +204,12 @@ jobs: - name: Build with PHP ${{ steps.setup-php.outputs.php-version }} & Symfony ${{ env.SYMFONY_VERSION }} run: | + # Rely on "composer update --with" rather than "composer require" ! + # => it ensures the tested version is actually allowed by constraints + # ("composer require" would override those constraints, which may not produce something actually installable by end-user) SF_CONSTRAINT="~${{ env.SYMFONY_VERSION }}.0" - composer require -W \ - symfony/validator:${SF_CONSTRAINT} \ + composer update --no-install --with-all-dependencies --minimal-changes \ + --with "symfony/validator:${SF_CONSTRAINT}" \ && make build - name: ComposerRequireChecker @@ -214,7 +220,7 @@ jobs: uses: actions/dependency-review-action@v4 nightly-tests: - name: Nightly - ${{ matrix.job-name }} + name: Nightly - PHP ${{ matrix.php-version }} & Sf ${{ matrix.symfony-version }} - ${{ matrix.job-name }} needs: [ fetch-supported-versions, tests ] if: ${{ github.event_name == 'push' || ( github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'with-nightly-tests') ) }} runs-on: ubuntu-latest @@ -227,23 +233,23 @@ jobs: fail-fast: false matrix: include: - - job-name: PHP - With highest supported Symfony versions + - job-name: PHP with highest supported Symfony versions php-version: ${{ needs.fetch-supported-versions.outputs.php-next }} symfony-version: ${{ needs.fetch-supported-versions.outputs.symfony-max }} # Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317) pkg-extra-constraints: behat/gherkin:~4.12.0 - - job-name: PHP - With lowest supported Symfony versions + - job-name: PHP with lowest supported Symfony versions php-version: ${{ needs.fetch-supported-versions.outputs.php-next }} symfony-version: ${{ needs.fetch-supported-versions.outputs.symfony-min }} # Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317) pkg-extra-constraints: behat/gherkin:~4.12.0 - - job-name: Symfony - With highest supported PHP version + - job-name: Symfony with highest supported PHP version php-version: ${{ needs.fetch-supported-versions.outputs.php-max }} symfony-version: ${{ needs.fetch-supported-versions.outputs.symfony-next }} # Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317) # Fix - symfony/framework-bundle - Framework bundle <7.0 require php 8.1 minimum ! pkg-extra-constraints: behat/gherkin:~4.12.0 ${{ ( needs.fetch-supported-versions.outputs.symfony-next == '7.0' && needs.fetch-supported-versions.outputs.php-max == '8.4' ) && 'symfony/framework-bundle:~7.0.0@dev' || '' }} - - job-name: Symfony - With lowest supported PHP version + - job-name: Symfony with lowest supported PHP version # Fix - Sf 7.0 require php 8.1 minimum, most of deps require 8.2 ! php-version: ${{ ( needs.fetch-supported-versions.outputs.symfony-next == '7.0' && needs.fetch-supported-versions.outputs.php-min == '8.0' ) && '8.2' || needs.fetch-supported-versions.outputs.php-min }} symfony-version: ${{ needs.fetch-supported-versions.outputs.symfony-next }} @@ -280,10 +286,12 @@ jobs: - name: Build with PHP ${{ steps.setup-php.outputs.php-version }} & Symfony ${{ matrix.symfony-version }} run: | + # For nightly builds, rely on "composer require" rather than "composer update --with" ! + # => tested version is likely outside of constraints, in that case "composer update --with" would fail SF_CONSTRAINT="~${{ matrix.symfony-version }}.0@dev" composer config minimum-stability dev \ - && composer require -W \ - symfony/validator:${SF_CONSTRAINT} \ + && composer require --no-install --with-all-dependencies --minimal-changes \ + --with "symfony/validator:${SF_CONSTRAINT}" \ ${{ matrix.pkg-extra-constraints }} \ && make build From 31004248ff385e5daeab36dbd069ff232d718959 Mon Sep 17 00:00:00 2001 From: Yoanm <4410697+yoanm@users.noreply.github.com> Date: Wed, 3 Sep 2025 10:20:35 +0200 Subject: [PATCH 09/14] Fix --- .github/workflows/reusable-CI-workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reusable-CI-workflow.yml b/.github/workflows/reusable-CI-workflow.yml index 30960d8..7c253e7 100644 --- a/.github/workflows/reusable-CI-workflow.yml +++ b/.github/workflows/reusable-CI-workflow.yml @@ -291,7 +291,7 @@ jobs: SF_CONSTRAINT="~${{ matrix.symfony-version }}.0@dev" composer config minimum-stability dev \ && composer require --no-install --with-all-dependencies --minimal-changes \ - --with "symfony/validator:${SF_CONSTRAINT}" \ + symfony/validator:${SF_CONSTRAINT} \ ${{ matrix.pkg-extra-constraints }} \ && make build From 018cb7fe9322046eebe0f8cad3b323146ea6ce5a Mon Sep 17 00:00:00 2001 From: Yoanm <4410697+yoanm@users.noreply.github.com> Date: Wed, 3 Sep 2025 10:26:32 +0200 Subject: [PATCH 10/14] Remove spaces --- .github/workflows/reusable-CI-workflow.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/reusable-CI-workflow.yml b/.github/workflows/reusable-CI-workflow.yml index 7c253e7..2150707 100644 --- a/.github/workflows/reusable-CI-workflow.yml +++ b/.github/workflows/reusable-CI-workflow.yml @@ -120,7 +120,7 @@ jobs: - name: Build with PHP ${{ steps.setup-php.outputs.php-version }} & Symfony ${{ matrix.symfony-version }} run: | # Rely on "composer update --with" rather than "composer require" ! - # => it ensures the tested version is actually allowed by constraints + # => it ensures the tested version is actually allowed by constraints # ("composer require" would override those constraints, which may not produce something actually installable by end-user) SF_CONSTRAINT="~${{ matrix.symfony-version }}.0" composer update --no-install --with-all-dependencies --minimal-changes \ @@ -205,7 +205,7 @@ jobs: - name: Build with PHP ${{ steps.setup-php.outputs.php-version }} & Symfony ${{ env.SYMFONY_VERSION }} run: | # Rely on "composer update --with" rather than "composer require" ! - # => it ensures the tested version is actually allowed by constraints + # => it ensures the tested version is actually allowed by constraints # ("composer require" would override those constraints, which may not produce something actually installable by end-user) SF_CONSTRAINT="~${{ env.SYMFONY_VERSION }}.0" composer update --no-install --with-all-dependencies --minimal-changes \ From b8fc1d2975a9359f71eccf04d1e7c460adaa14cb Mon Sep 17 00:00:00 2001 From: Yoanm <4410697+yoanm@users.noreply.github.com> Date: Wed, 3 Sep 2025 10:29:08 +0200 Subject: [PATCH 11/14] Improve --- .github/workflows/reusable-CI-workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reusable-CI-workflow.yml b/.github/workflows/reusable-CI-workflow.yml index 3e453fb..7c7f132 100644 --- a/.github/workflows/reusable-CI-workflow.yml +++ b/.github/workflows/reusable-CI-workflow.yml @@ -209,7 +209,7 @@ jobs: # ("composer require" would override those constraints, which may not produce something actually installable by end-user) SF_CONSTRAINT="~${{ env.SYMFONY_VERSION }}.0" composer update --no-install --with-all-dependencies --minimal-changes \ - --with "symfony/validator:${SF_CONSTRAINT}" \ + --with "symfony/validator:${SF_CONSTRAINT}" \ && make build - name: ComposerRequireChecker From da1b4ddb06216761d4174fb2133d658b7d3afae6 Mon Sep 17 00:00:00 2001 From: Yoanm <4410697+yoanm@users.noreply.github.com> Date: Wed, 3 Sep 2025 12:25:24 +0200 Subject: [PATCH 12/14] Add supported-versions.json file hash for cache --- .github/workflows/reusable-CI-workflow.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/reusable-CI-workflow.yml b/.github/workflows/reusable-CI-workflow.yml index 7c7f132..f4f5605 100644 --- a/.github/workflows/reusable-CI-workflow.yml +++ b/.github/workflows/reusable-CI-workflow.yml @@ -9,6 +9,7 @@ permissions: env: COMPOSER_PREFER_STABLE: '1' TEST_OUTPUT_STYLE: pretty + SUPPORTED_VERSIONS_FILE_PATH: .github/workflows/supported-versions.json jobs: fetch-supported-versions: @@ -28,7 +29,7 @@ jobs: id: fetch-file uses: yoanm/gha-supported-versions-parser/github-downloader@v1 with: - file-path: .github/workflows/supported-versions.json + file-path: ${{ env.SUPPORTED_VERSIONS_FILE_PATH }} - name: Fetch PHP supported versions id: fetch-php-versions @@ -66,7 +67,7 @@ jobs: php-version: '${{ needs.fetch-supported-versions.outputs.php-max }}' symfony-version: '6.4' # Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317) - pkg-extra-constraints: --with 'behat/gherkin:~4.12.0' + pkg-extra-constraints: --with 'behat/gherkin:~4.12.0' ${{ ( needs.fetch-supported-versions.outputs.symfony-max == '6.4' ) && '--with "symfony/yaml:~6.4.0"' || '' }} - job-name: Bare minimum # => Lowest versions allowed by composer config php-version: '${{ needs.fetch-supported-versions.outputs.php-min }}' symfony-version: '${{ needs.fetch-supported-versions.outputs.symfony-min }}' @@ -115,7 +116,7 @@ jobs: path: | ${{ steps.composer-cache.outputs.dir }} # Clear the cache if composer.json (as composer.lock is not available) has been updated - key: tests-php${{ steps.setup-php.outputs.php-version }}-sf${{ matrix.symfony-version }}-${{ hashFiles('composer.json') }} + key: tests-php${{ steps.setup-php.outputs.php-version }}-sf${{ matrix.symfony-version }}-${{ hashFiles('composer.json', env.SUPPORTED_VERSIONS_FILE_PATH) }} - name: Build with PHP ${{ steps.setup-php.outputs.php-version }} & Symfony ${{ matrix.symfony-version }} run: | @@ -200,7 +201,7 @@ jobs: path: | ${{ steps.composer-cache.outputs.dir }} # Clear the cache if composer.json (as composer.lock is not available) has been updated - key: tests-php${{ steps.setup-php.outputs.php-version }}-sf${{ env.SYMFONY_VERSION }}-${{ hashFiles('composer.json') }} + key: tests-php${{ steps.setup-php.outputs.php-version }}-sf${{ env.SYMFONY_VERSION }}-${{ hashFiles('composer.json', env.SUPPORTED_VERSIONS_FILE_PATH) }} - name: Build with PHP ${{ steps.setup-php.outputs.php-version }} & Symfony ${{ env.SYMFONY_VERSION }} run: | @@ -280,7 +281,7 @@ jobs: path: | ${{ steps.composer-cache.outputs.dir }} # Clear the cache if composer.json (as composer.lock is not available) has been updated - key: tests-php${{ steps.setup-php.outputs.php-version }}-sf${{ matrix.symfony-version }}-${{ hashFiles('composer.json') }} + key: tests-php${{ steps.setup-php.outputs.php-version }}-sf${{ matrix.symfony-version }}-${{ hashFiles('composer.json', env.SUPPORTED_VERSIONS_FILE_PATH) }} - name: Build with PHP ${{ steps.setup-php.outputs.php-version }} & Symfony ${{ matrix.symfony-version }} run: | From 15dc4d1c948f84036a77043ab021f5ba2babe531 Mon Sep 17 00:00:00 2001 From: Yoanm <4410697+yoanm@users.noreply.github.com> Date: Wed, 3 Sep 2025 12:28:05 +0200 Subject: [PATCH 13/14] Trigger CI From fa744bab48e332d578e0eddd59460c373558c58b Mon Sep 17 00:00:00 2001 From: Yoanm <4410697+yoanm@users.noreply.github.com> Date: Wed, 3 Sep 2025 13:46:30 +0200 Subject: [PATCH 14/14] Remove useless --- .github/workflows/reusable-CI-workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reusable-CI-workflow.yml b/.github/workflows/reusable-CI-workflow.yml index f4f5605..5d25a6a 100644 --- a/.github/workflows/reusable-CI-workflow.yml +++ b/.github/workflows/reusable-CI-workflow.yml @@ -67,7 +67,7 @@ jobs: php-version: '${{ needs.fetch-supported-versions.outputs.php-max }}' symfony-version: '6.4' # Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317) - pkg-extra-constraints: --with 'behat/gherkin:~4.12.0' ${{ ( needs.fetch-supported-versions.outputs.symfony-max == '6.4' ) && '--with "symfony/yaml:~6.4.0"' || '' }} + pkg-extra-constraints: --with 'behat/gherkin:~4.12.0' - job-name: Bare minimum # => Lowest versions allowed by composer config php-version: '${{ needs.fetch-supported-versions.outputs.php-min }}' symfony-version: '${{ needs.fetch-supported-versions.outputs.symfony-min }}'