@@ -119,6 +119,9 @@ 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"
123126 composer update --no-install --with-all-dependencies --minimal-changes \
124127 --with "symfony/validator:${SF_CONSTRAINT}" \
@@ -201,6 +204,9 @@ 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"
205211 composer update --no-install --with-all-dependencies --minimal-changes \
206212 --with "symfony/validator:${SF_CONSTRAINT}" \
@@ -231,25 +237,23 @@ jobs:
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)
234- pkg-extra-constraints : --with ' behat/gherkin:~4.12.0'
240+ pkg-extra-constraints : behat/gherkin:~4.12.0
235241 - 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)
239- pkg-extra-constraints : --with ' behat/gherkin:~4.12.0'
245+ pkg-extra-constraints : behat/gherkin:~4.12.0
240246 - 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)
244- # Fix - symfony/framework-bundle - Framework bundle <7.0 require php 8.1 minimum !
245- pkg-extra-constraints : --with 'behat/gherkin:~4.12.0'
250+ pkg-extra-constraints : behat/gherkin:~4.12.0
246251 - job-name : Symfony with lowest supported PHP version
247252 # Fix - symfony/validator 7.1 require php 8.2 minimum !
248253 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 }}
249254 symfony-version : ${{ needs.fetch-supported-versions.outputs.symfony-next }}
250255 # Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317)
251- # Fix - symfony/framework-bundle - Framework bundle <7.0 require php 8.1 minimum !
252- pkg-extra-constraints : --with 'behat/gherkin:~4.12.0'
256+ pkg-extra-constraints : behat/gherkin:~4.12.0
253257
254258 steps :
255259 - name : Check out code
@@ -280,10 +284,12 @@ jobs:
280284
281285 - name : Build with PHP ${{ steps.setup-php.outputs.php-version }} & Symfony ${{ matrix.symfony-version }}
282286 run : |
287+ # For nightly builds, rely on "composer require" rather than "composer update --with" !
288+ # => tested version is likely outside of constraints, in that case "composer update --with" would fail
283289 SF_CONSTRAINT="~${{ matrix.symfony-version }}.0@dev"
284290 composer config minimum-stability dev \
285- && composer update --no-install --with-all-dependencies --minimal-changes \
286- --with " symfony/validator:${SF_CONSTRAINT}" \
291+ && composer require --no-install --with-all-dependencies --minimal-changes \
292+ symfony/validator:${SF_CONSTRAINT} \
287293 ${{ matrix.pkg-extra-constraints }} \
288294 && make build
289295
0 commit comments