Skip to content

Commit e5c0e1f

Browse files
committed
Improve
2 parents 243c4e1 + 3100424 commit e5c0e1f

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

.github/workflows/dependabot-PRs.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ permissions:
77

88
jobs:
99
dependabot:
10+
name: Auto-merge & Labels
11+
if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'yoanm/php-jsonrpc-params-symfony-validator-sdk'
1012
runs-on: ubuntu-latest
1113
permissions:
1214
contents: write
1315
pull-requests: write
14-
if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'yoanm/php-jsonrpc-params-symfony-validator-sdk'
1516
steps:
1617
- name: Dependabot metadata
1718
id: metadata

.github/workflows/reusable-CI-workflow.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)