Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: PR auto-merge
name: Dependabot PRs
on: pull_request

permissions:
Expand All @@ -7,11 +7,12 @@ permissions:

jobs:
dependabot:
name: Auto-merge & Labels
if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'yoanm/symfony-jsonrpc-http-server-doc'
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'yoanm/symfony-jsonrpc-http-server-doc'
steps:
- name: Dependabot metadata
id: metadata
Expand Down
56 changes: 32 additions & 24 deletions .github/workflows/reusable-CI-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -61,27 +61,27 @@ 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)
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 }}'
- 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
Expand Down Expand Up @@ -118,12 +118,15 @@ 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/config:${SF_CONSTRAINT} \
symfony/dependency-injection:${SF_CONSTRAINT} \
symfony/http-foundation:${SF_CONSTRAINT} \
symfony/http-kernel:${SF_CONSTRAINT} \
composer update --no-install --with-all-dependencies --minimal-changes \
--with "symfony/config:${SF_CONSTRAINT}" \
--with "symfony/dependency-injection:${SF_CONSTRAINT}" \
--with "symfony/http-foundation:${SF_CONSTRAINT}" \
--with "symfony/http-kernel:${SF_CONSTRAINT}" \
${{ matrix.pkg-extra-constraints }} \
&& make build

Expand Down Expand Up @@ -203,12 +206,15 @@ 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/config:${SF_CONSTRAINT} \
symfony/dependency-injection:${SF_CONSTRAINT} \
symfony/http-foundation:${SF_CONSTRAINT} \
symfony/http-kernel:${SF_CONSTRAINT} \
composer update --no-install --with-all-dependencies --minimal-changes \
--with "symfony/config:${SF_CONSTRAINT}" \
--with "symfony/dependency-injection:${SF_CONSTRAINT}" \
--with "symfony/http-foundation:${SF_CONSTRAINT}" \
--with "symfony/http-kernel:${SF_CONSTRAINT}" \
&& make build

- name: ComposerRequireChecker
Expand All @@ -219,7 +225,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
Expand All @@ -232,23 +238,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 }}
Expand Down Expand Up @@ -285,9 +291,11 @@ 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 \
&& composer require --no-install --with-all-dependencies --minimal-changes \
symfony/config:${SF_CONSTRAINT} \
symfony/dependency-injection:${SF_CONSTRAINT} \
symfony/http-foundation:${SF_CONSTRAINT} \
Expand Down
Loading