45
45
dependency : symfony
46
46
47
47
tests :
48
- name : ${{ matrix.job-name }}
48
+ name : PHP ${{ matrix.php-version }} & Sf ${{ matrix.symfony-version }} - ${{ matrix.job-name }}
49
49
needs : [fetch-supported-versions]
50
50
runs-on : ubuntu-latest
51
51
permissions :
@@ -61,28 +61,28 @@ jobs:
61
61
php-version : ' ${{ needs.fetch-supported-versions.outputs.php-max }}'
62
62
symfony-version : ' ${{ needs.fetch-supported-versions.outputs.symfony-max }}'
63
63
# 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
66
66
php-version : ' ${{ needs.fetch-supported-versions.outputs.php-max }}'
67
67
symfony-version : ' 5.4'
68
68
# Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317)
69
69
# 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" ' || '' }}
71
71
- job-name : Bare minimum # => Lowest versions allowed by composer config
72
72
php-version : ' ${{ needs.fetch-supported-versions.outputs.php-min }}'
73
73
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
75
75
php-version : ' ${{ needs.fetch-supported-versions.outputs.php-min }}'
76
76
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
78
78
# Fix - Sf 6.4 require php 8.1 minimum !
79
79
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 }}
80
80
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
82
82
php-version : ' ${{ needs.fetch-supported-versions.outputs.php-max }}'
83
83
symfony-version : ' ${{ needs.fetch-supported-versions.outputs.symfony-min }}'
84
84
# 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'
86
86
steps :
87
87
- name : Check out code
88
88
uses : actions/checkout@v5
@@ -119,11 +119,14 @@ jobs:
119
119
120
120
- name : Build with PHP ${{ steps.setup-php.outputs.php-version }} & Symfony ${{ matrix.symfony-version }}
121
121
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)
122
125
SF_CONSTRAINT="~${{ matrix.symfony-version }}.0"
123
- composer require -W \
124
- symfony/config:${SF_CONSTRAINT} \
125
- symfony/dependency-injection:${SF_CONSTRAINT} \
126
- symfony/http-kernel:${SF_CONSTRAINT} \
126
+ composer update --no-install --with-all-dependencies --minimal-changes \
127
+ --with " symfony/config:${SF_CONSTRAINT}" \
128
+ --with " symfony/dependency-injection:${SF_CONSTRAINT}" \
129
+ --with " symfony/http-kernel:${SF_CONSTRAINT}" \
127
130
${{ matrix.pkg-extra-constraints }} \
128
131
&& make build
129
132
@@ -203,11 +206,14 @@ jobs:
203
206
204
207
- name : Build with PHP ${{ steps.setup-php.outputs.php-version }} & Symfony ${{ env.SYMFONY_VERSION }}
205
208
run : |
209
+ # Rely on "composer update --with" rather than "composer require" !
210
+ # => it ensures the tested version is actually allowed by constraints
211
+ # ("composer require" would override those constraints, which may not produce something actually installable by end-user)
206
212
SF_CONSTRAINT="~${{ env.SYMFONY_VERSION }}.0"
207
- composer require -W \
208
- symfony/config:${SF_CONSTRAINT} \
209
- symfony/dependency-injection:${SF_CONSTRAINT} \
210
- symfony/http-kernel:${SF_CONSTRAINT} \
213
+ composer update --no-install --with-all-dependencies --minimal-changes \
214
+ --with " symfony/config:${SF_CONSTRAINT}" \
215
+ --with " symfony/dependency-injection:${SF_CONSTRAINT}" \
216
+ --with " symfony/http-kernel:${SF_CONSTRAINT}" \
211
217
&& make build
212
218
213
219
- name : ComposerRequireChecker
@@ -218,7 +224,7 @@ jobs:
218
224
uses : actions/dependency-review-action@v4
219
225
220
226
nightly-tests :
221
- name : Nightly - ${{ matrix.job-name }}
227
+ name : Nightly - PHP ${{ matrix.php-version }} & Sf ${{ matrix.symfony-version }} - ${{ matrix.job-name }}
222
228
needs : [ fetch-supported-versions, tests ]
223
229
if : ${{ github.event_name == 'push' || ( github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'with-nightly-tests') ) }}
224
230
runs-on : ubuntu-latest
@@ -231,23 +237,23 @@ jobs:
231
237
fail-fast : false
232
238
matrix :
233
239
include :
234
- - job-name : PHP - With highest supported Symfony versions
240
+ - job-name : PHP with highest supported Symfony versions
235
241
php-version : ${{ needs.fetch-supported-versions.outputs.php-next }}
236
242
symfony-version : ${{ needs.fetch-supported-versions.outputs.symfony-max }}
237
243
# Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317)
238
244
pkg-extra-constraints : behat/gherkin:~4.12.0
239
- - job-name : PHP - With lowest supported Symfony versions
245
+ - job-name : PHP with lowest supported Symfony versions
240
246
php-version : ${{ needs.fetch-supported-versions.outputs.php-next }}
241
247
symfony-version : ${{ needs.fetch-supported-versions.outputs.symfony-min }}
242
248
# Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317)
243
249
pkg-extra-constraints : behat/gherkin:~4.12.0
244
- - job-name : Symfony - With highest supported PHP version
250
+ - job-name : Symfony with highest supported PHP version
245
251
php-version : ${{ needs.fetch-supported-versions.outputs.php-max }}
246
252
symfony-version : ${{ needs.fetch-supported-versions.outputs.symfony-next }}
247
253
# Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317)
248
254
# Fix - symfony/framework-bundle - Framework bundle <7.0 require php 8.1 minimum !
249
255
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' || '' }}
250
- - job-name : Symfony - With lowest supported PHP version
256
+ - job-name : Symfony with lowest supported PHP version
251
257
# Fix - Sf 7.0 require php 8.1 minimum, most of deps require 8.2 !
252
258
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 }}
253
259
symfony-version : ${{ needs.fetch-supported-versions.outputs.symfony-next }}
@@ -284,9 +290,11 @@ jobs:
284
290
285
291
- name : Build with PHP ${{ steps.setup-php.outputs.php-version }} & Symfony ${{ matrix.symfony-version }}
286
292
run : |
293
+ # For nightly builds, rely on "composer require" rather than "composer update --with" !
294
+ # => tested version is likely outside of constraints, in that case "composer update --with" would fail
287
295
SF_CONSTRAINT="~${{ matrix.symfony-version }}.0@dev"
288
296
composer config minimum-stability dev \
289
- && composer require -W \
297
+ && composer require --no-install --with-all-dependencies --minimal-changes \
290
298
symfony/config:${SF_CONSTRAINT} \
291
299
symfony/dependency-injection:${SF_CONSTRAINT} \
292
300
symfony/http-kernel:${SF_CONSTRAINT} \
0 commit comments