4545 dependency : symfony
4646
4747 tests :
48- name : ${{ matrix.job-name }}
48+ name : PHP ${{ matrix.php-version }} & Sf ${{ matrix.symfony-version }} - ${{ matrix.job-name }}
4949 needs : [fetch-supported-versions]
5050 runs-on : ubuntu-latest
5151 permissions :
@@ -61,28 +61,28 @@ jobs:
6161 php-version : ' ${{ needs.fetch-supported-versions.outputs.php-max }}'
6262 symfony-version : ' ${{ needs.fetch-supported-versions.outputs.symfony-max }}'
6363 # Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317)
64- pkg-extra-constraints : behat/gherkin:~4.12.0
65- - job-name : Up to date versions - Special case - Symfony 5.4
64+ pkg-extra-constraints : --with ' behat/gherkin:~4.12.0'
65+ - job-name : Up to date versions - Sf 5.4 case
6666 php-version : ' ${{ needs.fetch-supported-versions.outputs.php-max }}'
6767 symfony-version : ' 5.4'
6868 # Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317)
6969 # Fix - symfony/yaml - Avoid issue with Sf YAML 6.4+ and Framework bundle
70- pkg-extra-constraints : behat/gherkin:~4.12.0 ${{ ( needs.fetch-supported-versions.outputs.symfony-max == '6.4' ) && 'symfony/yaml:~6.4.0' || '' }}
70+ pkg-extra-constraints : --with ' behat/gherkin:~4.12.0' ${{ ( needs.fetch-supported-versions.outputs.symfony-max == '6.4' ) && '--with " symfony/yaml:~6.4.0" ' || '' }}
7171 - job-name : Bare minimum # => Lowest versions allowed by composer config
7272 php-version : ' ${{ needs.fetch-supported-versions.outputs.php-min }}'
7373 symfony-version : ' ${{ needs.fetch-supported-versions.outputs.symfony-min }}'
74- - job-name : Bare minimum - Special case - Symfony 5.4
74+ - job-name : Bare minimum - Sf 5.4 case
7575 php-version : ' ${{ needs.fetch-supported-versions.outputs.php-min }}'
7676 symfony-version : ' 5.4'
77- - job-name : Late migration - PHP # => Highest symfony version with lowest php version allowed by composer config
77+ - job-name : Late PHP migration # => Highest symfony version with lowest php version allowed by composer config
7878 # Fix - Sf 6.4 require php 8.1 minimum !
7979 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 }}
8080 symfony-version : ' ${{ needs.fetch-supported-versions.outputs.symfony-max }}'
81- - job-name : Late migration - Symfony # => Lowest symfony version with highest php version allowed by composer config
81+ - job-name : Late Symfony migration # => Lowest symfony version with highest php version allowed by composer config
8282 php-version : ' ${{ needs.fetch-supported-versions.outputs.php-max }}'
8383 symfony-version : ' ${{ needs.fetch-supported-versions.outputs.symfony-min }}'
8484 # Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317)
85- pkg-extra-constraints : behat/gherkin:~4.12.0
85+ pkg-extra-constraints : --with ' behat/gherkin:~4.12.0'
8686 steps :
8787 - name : Check out code
8888 uses : actions/checkout@v5
@@ -119,9 +119,12 @@ jobs:
119119
120120 - name : Build with PHP ${{ steps.setup-php.outputs.php-version }} & Symfony ${{ matrix.symfony-version }}
121121 run : |
122+ # Rely on "composer update --with" rather than "composer require" !
123+ # => it ensures the tested version is actually allowed by constraints
124+ # ("composer require" would override those constraints, which may not produce something actually installable by end-user)
122125 SF_CONSTRAINT="~${{ matrix.symfony-version }}.0"
123- composer require -W \
124- symfony/validator:${SF_CONSTRAINT} \
126+ composer update --no-install --with-all-dependencies --minimal-changes \
127+ --with " symfony/validator:${SF_CONSTRAINT}" \
125128 ${{ matrix.pkg-extra-constraints }} \
126129 && make build
127130
@@ -201,9 +204,12 @@ jobs:
201204
202205 - name : Build with PHP ${{ steps.setup-php.outputs.php-version }} & Symfony ${{ env.SYMFONY_VERSION }}
203206 run : |
207+ # Rely on "composer update --with" rather than "composer require" !
208+ # => it ensures the tested version is actually allowed by constraints
209+ # ("composer require" would override those constraints, which may not produce something actually installable by end-user)
204210 SF_CONSTRAINT="~${{ env.SYMFONY_VERSION }}.0"
205- composer require -W \
206- symfony/validator:${SF_CONSTRAINT} \
211+ composer update --no-install --with-all-dependencies --minimal-changes \
212+ --with " symfony/validator:${SF_CONSTRAINT}" \
207213 && make build
208214
209215 - name : ComposerRequireChecker
@@ -214,7 +220,7 @@ jobs:
214220 uses : actions/dependency-review-action@v4
215221
216222 nightly-tests :
217- name : Nightly - ${{ matrix.job-name }}
223+ name : Nightly - PHP ${{ matrix.php-version }} & Sf ${{ matrix.symfony-version }} - ${{ matrix.job-name }}
218224 needs : [ fetch-supported-versions, tests ]
219225 if : ${{ github.event_name == 'push' || ( github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'with-nightly-tests') ) }}
220226 runs-on : ubuntu-latest
@@ -227,23 +233,23 @@ jobs:
227233 fail-fast : false
228234 matrix :
229235 include :
230- - job-name : PHP - With highest supported Symfony versions
236+ - job-name : PHP with highest supported Symfony versions
231237 php-version : ${{ needs.fetch-supported-versions.outputs.php-next }}
232238 symfony-version : ${{ needs.fetch-supported-versions.outputs.symfony-max }}
233239 # Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317)
234240 pkg-extra-constraints : behat/gherkin:~4.12.0
235- - job-name : PHP - With lowest supported Symfony versions
241+ - job-name : PHP with lowest supported Symfony versions
236242 php-version : ${{ needs.fetch-supported-versions.outputs.php-next }}
237243 symfony-version : ${{ needs.fetch-supported-versions.outputs.symfony-min }}
238244 # Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317)
239245 pkg-extra-constraints : behat/gherkin:~4.12.0
240- - job-name : Symfony - With highest supported PHP version
246+ - job-name : Symfony with highest supported PHP version
241247 php-version : ${{ needs.fetch-supported-versions.outputs.php-max }}
242248 symfony-version : ${{ needs.fetch-supported-versions.outputs.symfony-next }}
243249 # Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317)
244250 # Fix - symfony/framework-bundle - Framework bundle <7.0 require php 8.1 minimum !
245251 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' || '' }}
246- - job-name : Symfony - With lowest supported PHP version
252+ - job-name : Symfony with lowest supported PHP version
247253 # Fix - Sf 7.0 require php 8.1 minimum, most of deps require 8.2 !
248254 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 }}
249255 symfony-version : ${{ needs.fetch-supported-versions.outputs.symfony-next }}
@@ -280,10 +286,12 @@ jobs:
280286
281287 - name : Build with PHP ${{ steps.setup-php.outputs.php-version }} & Symfony ${{ matrix.symfony-version }}
282288 run : |
289+ # For nightly builds, rely on "composer require" rather than "composer update --with" !
290+ # => tested version is likely outside of constraints, in that case "composer update --with" would fail
283291 SF_CONSTRAINT="~${{ matrix.symfony-version }}.0@dev"
284292 composer config minimum-stability dev \
285- && composer require -W \
286- symfony/validator:${SF_CONSTRAINT} \
293+ && composer require --no-install --with-all-dependencies --minimal-changes \
294+ --with " symfony/validator:${SF_CONSTRAINT}" \
287295 ${{ matrix.pkg-extra-constraints }} \
288296 && make build
289297
0 commit comments