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
1 change: 1 addition & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on: # Build any PRs and main branch changes
- '.github/workflows/coverage-upload.yml'
- '.github/workflows/reusable-CI-workflow.yml'
- '.github/workflows/reusable-coverage-upload-workflow.yml'
- '.github/workflows/reusable-nightly-tests-workflow.yml'
- '.github/workflows/auto-merge-dependabot.yml'
push:
branches: [ master ]
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/nightly-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: 'Nightly'
on:
workflow_run:
workflows: ["CI"]
types: [completed]

jobs:
nightly:
name: Nightly
permissions:
contents: read
checks: write # For the check run creation !
uses: ./.github/workflows/reusable-nightly-tests-workflow.yml
9 changes: 9 additions & 0 deletions .github/workflows/pre-check-CI-updates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ on:
- '.github/workflows/coverage-upload.yml'
- '.github/workflows/reusable-CI-workflow.yml'
- '.github/workflows/reusable-coverage-upload-workflow.yml'
- '.github/workflows/reusable-nightly-tests-workflow.yml'
- '.github/workflows/auto-merge-dependabot.yml'

concurrency:
Expand All @@ -29,6 +30,14 @@ jobs:
contents: read
uses: ./.github/workflows/reusable-CI-workflow.yml

nightly:
name: Nightly
needs: [tests]
permissions:
contents: read
checks: write # For the check run creation !
uses: ./.github/workflows/reusable-nightly-tests-workflow.yml

upload:
name: Upload
needs: [tests]
Expand Down
89 changes: 11 additions & 78 deletions .github/workflows/reusable-CI-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,16 @@ env:
COMPOSER_PREFER_STABLE: '1'
TEST_OUTPUT_STYLE: pretty


permissions:
contents: read

jobs:
fetch-supported-versions:
name: Fetch supported versions
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
php-min: ${{ steps.fetch-php-versions.outputs.min }}
php-max: ${{ steps.fetch-php-versions.outputs.max }}
Expand All @@ -25,6 +31,7 @@ jobs:
with:
dependency: php
path: .github/workflows/supported-versions.json

- name: Fetch Symfony supported versions
id: fetch-symfony-versions
uses: yoanm/gha-supported-versions-parser@feature/init
Expand All @@ -36,6 +43,8 @@ jobs:
name: ${{ matrix.job-name }}
needs: [fetch-supported-versions]
runs-on: ubuntu-latest
permissions:
contents: read
env:
COVERAGE_TYPE: none
COVERAGE_OUTPUT_STYLE: clover
Expand Down Expand Up @@ -157,6 +166,8 @@ jobs:
name: Static analysis
needs: [fetch-supported-versions]
runs-on: ubuntu-latest
permissions:
contents: read
env:
PHP_VERSION: ${{ needs.fetch-supported-versions.outputs.php-max }}
SYMFONY_VERSION: ${{ needs.fetch-supported-versions.outputs.symfony-max }}
Expand Down Expand Up @@ -203,81 +214,3 @@ jobs:
- name: Dependencies check
if: ${{ github.event_name == 'pull_request' }}
uses: actions/dependency-review-action@v4

nightly-tests:
name: Nightly - ${{ matrix.job-name }}
needs: [ fetch-supported-versions, tests ]
runs-on: ubuntu-latest
continue-on-error: true
env:
COMPOSER_IGNORE_PLATFORM_REQ: 'php+'
strategy:
fail-fast: false
matrix:
include:
- 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
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
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
# 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 }}
# 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-min == '8.0' ) && 'symfony/framework-bundle:~7.0.0@dev' || '' }}

steps:
- name: Check out code
uses: actions/checkout@v5

- name: Setup PHP ${{ matrix.php-version }}
id: setup-php
uses: shivammathur/setup-php@v2
env:
update: true # whether to use latest available patch for the version or not
fail-fast: true # step will fail if an extension or tool fails to set up
with:
php-version: ${{ matrix.php-version }}
tools: composer
coverage: none

- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Setup cache for PHP ${{ steps.setup-php.outputs.php-version }} & Symfony ${{ matrix.symfony-version }}
uses: actions/cache@v4
with:
path: |
${{ steps.composer-cache.outputs.dir }}
# Clear the cache if composer.json (as composer.lock is not available) has been updated
key: tests-php${{ steps.setup-php.outputs.php-version }}-sf${{ matrix.symfony-version }}-${{ hashFiles('composer.json') }}

- name: Build with PHP ${{ steps.setup-php.outputs.php-version }} & Symfony ${{ matrix.symfony-version }}
run: |
SF_CONSTRAINT="~${{ matrix.symfony-version }}.0@dev"
composer config minimum-stability dev \
&& composer require -W \
symfony/config:${SF_CONSTRAINT} \
symfony/dependency-injection:${SF_CONSTRAINT} \
symfony/event-dispatcher:${SF_CONSTRAINT} \
symfony/http-foundation:${SF_CONSTRAINT} \
symfony/http-kernel:${SF_CONSTRAINT} \
${{ matrix.pkg-extra-constraints }} \
&& make build

- name: Test
run: make test-unit && make test-functional
4 changes: 4 additions & 0 deletions .github/workflows/reusable-coverage-upload-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
CODECOV_TOKEN:
required: true

permissions:
contents: read
checks: write # For the check run creation !

jobs:
fetch-info:
name: Fetch triggering workflow metadata
Expand Down
145 changes: 145 additions & 0 deletions .github/workflows/reusable-nightly-tests-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
name: 'Nightly reusable workflow'

on:
workflow_call:
inputs:
ref:
description: Reference in order to fetch code
type: string
required: false
default: "${{ github.event.workflow_run && github.event.workflow_run.referenced_workflows[0] && github.event.workflow_run.referenced_workflows[0].ref || github.ref }}"

env:
COMPOSER_PREFER_STABLE: '1'
TEST_OUTPUT_STYLE: pretty


permissions:
contents: read
checks: write # For the check run creation !

jobs:
fetch-supported-versions:
name: Fetch supported versions
runs-on: ubuntu-latest
permissions:
contents: read
checks: write # For the check run creation !
outputs:
php-min: ${{ steps.fetch-php-versions.outputs.min }}
php-max: ${{ steps.fetch-php-versions.outputs.max }}
php-next: ${{ steps.fetch-php-versions.outputs.next }}
symfony-min: ${{ steps.fetch-symfony-versions.outputs.min }}
symfony-max: ${{ steps.fetch-symfony-versions.outputs.max }}
symfony-next: ${{ steps.fetch-symfony-versions.outputs.next }}
steps:
- name: 'Check run ○'
uses: yoanm/temp-reports-group-workspace/utils/attach-check-run-to-triggering-workflow@v0
with:
name: 'Fetch supported versions'
fails-on-triggering-workflow-failure: true

- name: Fetch PHP supported versions
id: fetch-php-versions
uses: yoanm/gha-supported-versions-parser@feature/init
with:
path: .github/workflows/supported-versions.json
dependency: php
ref: "${{ inputs.ref }}"

- name: Fetch Symfony supported versions
id: fetch-symfony-versions
uses: yoanm/gha-supported-versions-parser@feature/init
with:
path: .github/workflows/supported-versions.json
dependency: symfony
ref: "${{ inputs.ref }}"

tests:
name: ${{ matrix.job-name }}
needs: [ fetch-supported-versions ]
runs-on: ubuntu-latest
continue-on-error: true
permissions:
contents: read
checks: write # For the check run creation !
env:
COMPOSER_IGNORE_PLATFORM_REQ: 'php+'
strategy:
fail-fast: false
matrix:
include:
- 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
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
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
# 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 }}
# 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-min == '8.0' ) && 'symfony/framework-bundle:~7.0.0@dev' || '' }}

steps:
- name: 'Check run ○'
uses: yoanm/temp-reports-group-workspace/utils/attach-check-run-to-triggering-workflow@v0
with:
name: ${{ matrix.job-name }}
fails-on-triggering-workflow-failure: true

- name: Check out code
uses: actions/checkout@v5
with:
ref: "${{ inputs.ref }}"

- name: Setup PHP ${{ matrix.php-version }}
id: setup-php
uses: shivammathur/setup-php@v2
env:
update: true # whether to use latest available patch for the version or not
fail-fast: true # step will fail if an extension or tool fails to set up
with:
php-version: ${{ matrix.php-version }}
tools: composer
coverage: none

- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Setup cache for PHP ${{ steps.setup-php.outputs.php-version }} & Symfony ${{ matrix.symfony-version }}
uses: actions/cache@v4
with:
path: |
${{ steps.composer-cache.outputs.dir }}
# Clear the cache if composer.json (as composer.lock is not available) has been updated
key: tests-php${{ steps.setup-php.outputs.php-version }}-sf${{ matrix.symfony-version }}-${{ hashFiles('composer.json') }}

- name: Build with PHP ${{ steps.setup-php.outputs.php-version }} & Symfony ${{ matrix.symfony-version }}
run: |
SF_CONSTRAINT="~${{ matrix.symfony-version }}.0@dev"
composer config minimum-stability dev \
&& composer require -W \
symfony/config:${SF_CONSTRAINT} \
symfony/dependency-injection:${SF_CONSTRAINT} \
symfony/event-dispatcher:${SF_CONSTRAINT} \
symfony/http-foundation:${SF_CONSTRAINT} \
symfony/http-kernel:${SF_CONSTRAINT} \
${{ matrix.pkg-extra-constraints }} \
&& make build

- name: Test
run: make test-unit && make test-functional
Loading