Skip to content

Commit 6d7dba4

Browse files
committed
Split nightly tests
1 parent 8d12ac1 commit 6d7dba4

File tree

6 files changed

+185
-78
lines changed

6 files changed

+185
-78
lines changed

.github/workflows/CI.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ on: # Build any PRs and main branch changes
1414
- '.github/workflows/coverage-upload.yml'
1515
- '.github/workflows/reusable-CI-workflow.yml'
1616
- '.github/workflows/reusable-coverage-upload-workflow.yml'
17+
- '.github/workflows/reusable-nightly-tests-workflow.yml'
1718
- '.github/workflows/auto-merge-dependabot.yml'
1819
push:
1920
branches: [ master ]

.github/workflows/nightly-tests.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: 'Nightly'
2+
on:
3+
workflow_run:
4+
workflows: ["CI"]
5+
types: [completed]
6+
7+
jobs:
8+
nightly:
9+
name: Nightly
10+
permissions:
11+
contents: read
12+
checks: write # For the check run creation !
13+
secrets:
14+
uses: ./.github/workflows/reusable-nightly-tests-workflow.yml

.github/workflows/pre-check-CI-updates.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ on:
1616
- '.github/workflows/coverage-upload.yml'
1717
- '.github/workflows/reusable-CI-workflow.yml'
1818
- '.github/workflows/reusable-coverage-upload-workflow.yml'
19+
- '.github/workflows/reusable-nightly-tests-workflow.yml'
1920
- '.github/workflows/auto-merge-dependabot.yml'
2021

2122
concurrency:
@@ -29,6 +30,15 @@ jobs:
2930
contents: read
3031
uses: ./.github/workflows/reusable-CI-workflow.yml
3132

33+
nightly:
34+
name: Nightly
35+
needs: [tests]
36+
permissions:
37+
contents: read
38+
checks: write # For the check run creation !
39+
secrets:
40+
uses: ./.github/workflows/reusable-nightly-tests-workflow.yml
41+
3242
upload:
3343
name: Upload
3444
needs: [tests]

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

Lines changed: 11 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,16 @@ env:
77
COMPOSER_PREFER_STABLE: '1'
88
TEST_OUTPUT_STYLE: pretty
99

10+
11+
permissions:
12+
contents: read
13+
1014
jobs:
1115
fetch-supported-versions:
1216
name: Fetch supported versions
1317
runs-on: ubuntu-latest
18+
permissions:
19+
contents: read
1420
outputs:
1521
php-min: ${{ steps.fetch-php-versions.outputs.min }}
1622
php-max: ${{ steps.fetch-php-versions.outputs.max }}
@@ -25,6 +31,7 @@ jobs:
2531
with:
2632
dependency: php
2733
path: .github/workflows/supported-versions.json
34+
2835
- name: Fetch Symfony supported versions
2936
id: fetch-symfony-versions
3037
uses: yoanm/gha-supported-versions-parser@feature/init
@@ -36,6 +43,8 @@ jobs:
3643
name: ${{ matrix.job-name }}
3744
needs: [fetch-supported-versions]
3845
runs-on: ubuntu-latest
46+
permissions:
47+
contents: read
3948
env:
4049
COVERAGE_TYPE: none
4150
COVERAGE_OUTPUT_STYLE: clover
@@ -157,6 +166,8 @@ jobs:
157166
name: Static analysis
158167
needs: [fetch-supported-versions]
159168
runs-on: ubuntu-latest
169+
permissions:
170+
contents: read
160171
env:
161172
PHP_VERSION: ${{ needs.fetch-supported-versions.outputs.php-max }}
162173
SYMFONY_VERSION: ${{ needs.fetch-supported-versions.outputs.symfony-max }}
@@ -203,81 +214,3 @@ jobs:
203214
- name: Dependencies check
204215
if: ${{ github.event_name == 'pull_request' }}
205216
uses: actions/dependency-review-action@v4
206-
207-
nightly-tests:
208-
name: Nightly - ${{ matrix.job-name }}
209-
needs: [ fetch-supported-versions, tests ]
210-
runs-on: ubuntu-latest
211-
continue-on-error: true
212-
env:
213-
COMPOSER_IGNORE_PLATFORM_REQ: 'php+'
214-
strategy:
215-
fail-fast: false
216-
matrix:
217-
include:
218-
- job-name: PHP - With highest supported Symfony versions
219-
php-version: ${{ needs.fetch-supported-versions.outputs.php-next }}
220-
symfony-version: ${{ needs.fetch-supported-versions.outputs.symfony-max }}
221-
# Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317)
222-
pkg-extra-constraints: behat/gherkin:~4.12.0
223-
- job-name: PHP - With lowest supported Symfony versions
224-
php-version: ${{ needs.fetch-supported-versions.outputs.php-next }}
225-
symfony-version: ${{ needs.fetch-supported-versions.outputs.symfony-min }}
226-
# Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317)
227-
pkg-extra-constraints: behat/gherkin:~4.12.0
228-
- job-name: Symfony - With highest supported PHP version
229-
php-version: ${{ needs.fetch-supported-versions.outputs.php-max }}
230-
symfony-version: ${{ needs.fetch-supported-versions.outputs.symfony-next }}
231-
# Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317)
232-
# Fix - symfony/framework-bundle - Framework bundle <7.0 require php 8.1 minimum !
233-
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' || '' }}
234-
- job-name: Symfony - With lowest supported PHP version
235-
# Fix - Sf 7.0 require php 8.1 minimum, most of deps require 8.2 !
236-
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 }}
237-
symfony-version: ${{ needs.fetch-supported-versions.outputs.symfony-next }}
238-
# Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317)
239-
# Fix - symfony/framework-bundle - Framework bundle <7.0 require php 8.1 minimum !
240-
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' || '' }}
241-
242-
steps:
243-
- name: Check out code
244-
uses: actions/checkout@v5
245-
246-
- name: Setup PHP ${{ matrix.php-version }}
247-
id: setup-php
248-
uses: shivammathur/setup-php@v2
249-
env:
250-
update: true # whether to use latest available patch for the version or not
251-
fail-fast: true # step will fail if an extension or tool fails to set up
252-
with:
253-
php-version: ${{ matrix.php-version }}
254-
tools: composer
255-
coverage: none
256-
257-
- name: Get composer cache directory
258-
id: composer-cache
259-
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
260-
261-
- name: Setup cache for PHP ${{ steps.setup-php.outputs.php-version }} & Symfony ${{ matrix.symfony-version }}
262-
uses: actions/cache@v4
263-
with:
264-
path: |
265-
${{ steps.composer-cache.outputs.dir }}
266-
# Clear the cache if composer.json (as composer.lock is not available) has been updated
267-
key: tests-php${{ steps.setup-php.outputs.php-version }}-sf${{ matrix.symfony-version }}-${{ hashFiles('composer.json') }}
268-
269-
- name: Build with PHP ${{ steps.setup-php.outputs.php-version }} & Symfony ${{ matrix.symfony-version }}
270-
run: |
271-
SF_CONSTRAINT="~${{ matrix.symfony-version }}.0@dev"
272-
composer config minimum-stability dev \
273-
&& composer require -W \
274-
symfony/config:${SF_CONSTRAINT} \
275-
symfony/dependency-injection:${SF_CONSTRAINT} \
276-
symfony/event-dispatcher:${SF_CONSTRAINT} \
277-
symfony/http-foundation:${SF_CONSTRAINT} \
278-
symfony/http-kernel:${SF_CONSTRAINT} \
279-
${{ matrix.pkg-extra-constraints }} \
280-
&& make build
281-
282-
- name: Test
283-
run: make test-unit && make test-functional

.github/workflows/reusable-coverage-upload-workflow.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ on:
88
CODECOV_TOKEN:
99
required: true
1010

11+
permissions:
12+
contents: read
13+
checks: write # For the check run creation !
14+
1115
jobs:
1216
fetch-info:
1317
name: Fetch triggering workflow metadata
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
name: 'Nightly reusable workflow'
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
ref:
7+
description: Reference in order to fetch code
8+
type: string
9+
required: false
10+
default: "${{ github.event.workflow_run && github.event.workflow_run.referenced_workflows[0] && github.event.workflow_run.referenced_workflows[0].ref || github.ref }}"
11+
12+
env:
13+
COMPOSER_PREFER_STABLE: '1'
14+
TEST_OUTPUT_STYLE: pretty
15+
16+
17+
permissions:
18+
contents: read
19+
checks: write # For the check run creation !
20+
21+
jobs:
22+
fetch-supported-versions:
23+
name: Fetch supported versions
24+
runs-on: ubuntu-latest
25+
permissions:
26+
contents: read
27+
checks: write # For the check run creation !
28+
outputs:
29+
php-min: ${{ steps.fetch-php-versions.outputs.min }}
30+
php-max: ${{ steps.fetch-php-versions.outputs.max }}
31+
php-next: ${{ steps.fetch-php-versions.outputs.next }}
32+
symfony-min: ${{ steps.fetch-symfony-versions.outputs.min }}
33+
symfony-max: ${{ steps.fetch-symfony-versions.outputs.max }}
34+
symfony-next: ${{ steps.fetch-symfony-versions.outputs.next }}
35+
steps:
36+
- name: 'Check run ○'
37+
uses: yoanm/temp-reports-group-workspace/utils/attach-check-run-to-triggering-workflow@v0
38+
with:
39+
name: 'Fetch supported versions'
40+
fails-on-triggering-workflow-failure: true
41+
42+
- name: Fetch PHP supported versions
43+
id: fetch-php-versions
44+
uses: yoanm/gha-supported-versions-parser@feature/init
45+
with:
46+
path: .github/workflows/supported-versions.json
47+
dependency: php
48+
ref: "${{ inputs.ref }}"
49+
50+
- name: Fetch Symfony supported versions
51+
id: fetch-symfony-versions
52+
uses: yoanm/gha-supported-versions-parser@feature/init
53+
with:
54+
path: .github/workflows/supported-versions.json
55+
dependency: symfony
56+
ref: "${{ inputs.ref }}"
57+
58+
tests:
59+
name: ${{ matrix.job-name }}
60+
needs: [ fetch-supported-versions ]
61+
runs-on: ubuntu-latest
62+
continue-on-error: true
63+
permissions:
64+
contents: read
65+
checks: write # For the check run creation !
66+
env:
67+
COMPOSER_IGNORE_PLATFORM_REQ: 'php+'
68+
strategy:
69+
fail-fast: false
70+
matrix:
71+
include:
72+
- job-name: PHP - With highest supported Symfony versions
73+
php-version: ${{ needs.fetch-supported-versions.outputs.php-next }}
74+
symfony-version: ${{ needs.fetch-supported-versions.outputs.symfony-max }}
75+
# Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317)
76+
pkg-extra-constraints: behat/gherkin:~4.12.0
77+
- job-name: PHP - With lowest supported Symfony versions
78+
php-version: ${{ needs.fetch-supported-versions.outputs.php-next }}
79+
symfony-version: ${{ needs.fetch-supported-versions.outputs.symfony-min }}
80+
# Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317)
81+
pkg-extra-constraints: behat/gherkin:~4.12.0
82+
- job-name: Symfony - With highest supported PHP version
83+
php-version: ${{ needs.fetch-supported-versions.outputs.php-max }}
84+
symfony-version: ${{ needs.fetch-supported-versions.outputs.symfony-next }}
85+
# Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317)
86+
# Fix - symfony/framework-bundle - Framework bundle <7.0 require php 8.1 minimum !
87+
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' || '' }}
88+
- job-name: Symfony - With lowest supported PHP version
89+
# Fix - Sf 7.0 require php 8.1 minimum, most of deps require 8.2 !
90+
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 }}
91+
symfony-version: ${{ needs.fetch-supported-versions.outputs.symfony-next }}
92+
# Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317)
93+
# Fix - symfony/framework-bundle - Framework bundle <7.0 require php 8.1 minimum !
94+
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' || '' }}
95+
96+
steps:
97+
- name: 'Check run ○'
98+
uses: yoanm/temp-reports-group-workspace/utils/attach-check-run-to-triggering-workflow@v0
99+
with:
100+
name: ${{ matrix.job-name }}
101+
fails-on-triggering-workflow-failure: true
102+
103+
- name: Check out code
104+
uses: actions/checkout@v5
105+
with:
106+
ref: "${{ inputs.ref }}"
107+
108+
- name: Setup PHP ${{ matrix.php-version }}
109+
id: setup-php
110+
uses: shivammathur/setup-php@v2
111+
env:
112+
update: true # whether to use latest available patch for the version or not
113+
fail-fast: true # step will fail if an extension or tool fails to set up
114+
with:
115+
php-version: ${{ matrix.php-version }}
116+
tools: composer
117+
coverage: none
118+
119+
- name: Get composer cache directory
120+
id: composer-cache
121+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
122+
123+
- name: Setup cache for PHP ${{ steps.setup-php.outputs.php-version }} & Symfony ${{ matrix.symfony-version }}
124+
uses: actions/cache@v4
125+
with:
126+
path: |
127+
${{ steps.composer-cache.outputs.dir }}
128+
# Clear the cache if composer.json (as composer.lock is not available) has been updated
129+
key: tests-php${{ steps.setup-php.outputs.php-version }}-sf${{ matrix.symfony-version }}-${{ hashFiles('composer.json') }}
130+
131+
- name: Build with PHP ${{ steps.setup-php.outputs.php-version }} & Symfony ${{ matrix.symfony-version }}
132+
run: |
133+
SF_CONSTRAINT="~${{ matrix.symfony-version }}.0@dev"
134+
composer config minimum-stability dev \
135+
&& composer require -W \
136+
symfony/config:${SF_CONSTRAINT} \
137+
symfony/dependency-injection:${SF_CONSTRAINT} \
138+
symfony/event-dispatcher:${SF_CONSTRAINT} \
139+
symfony/http-foundation:${SF_CONSTRAINT} \
140+
symfony/http-kernel:${SF_CONSTRAINT} \
141+
${{ matrix.pkg-extra-constraints }} \
142+
&& make build
143+
144+
- name: Test
145+
run: make test-unit && make test-functional

0 commit comments

Comments
 (0)