@@ -3,14 +3,13 @@ name: 'CI reusable workflow'
33on :
44 workflow_call :
55
6+ permissions :
7+ contents : read
8+
69env :
710 COMPOSER_PREFER_STABLE : ' 1'
811 TEST_OUTPUT_STYLE : pretty
912
10-
11- permissions :
12- contents : read
13-
1413jobs :
1514 fetch-supported-versions :
1615 name : Fetch supported versions
@@ -214,3 +213,85 @@ jobs:
214213 - name : Dependencies check
215214 if : ${{ github.event_name == 'pull_request' }}
216215 uses : actions/dependency-review-action@v4
216+
217+ nightly-tests :
218+ name : Nightly - ${{ matrix.job-name }}
219+ needs : [ fetch-supported-versions, tests ]
220+ if : ${{ github.event_name == 'push' || ( github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'with-nightly-tests') ) }}
221+ runs-on : ubuntu-latest
222+ continue-on-error : true
223+ permissions :
224+ contents : read
225+ checks : write # For the check run creation !
226+ env :
227+ COMPOSER_IGNORE_PLATFORM_REQ : ' php+'
228+ strategy :
229+ fail-fast : false
230+ matrix :
231+ include :
232+ - job-name : PHP - With highest supported Symfony versions
233+ php-version : ${{ needs.fetch-supported-versions.outputs.php-next }}
234+ symfony-version : ${{ needs.fetch-supported-versions.outputs.symfony-max }}
235+ # Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317)
236+ pkg-extra-constraints : behat/gherkin:~4.12.0
237+ - job-name : PHP - With lowest supported Symfony versions
238+ php-version : ${{ needs.fetch-supported-versions.outputs.php-next }}
239+ symfony-version : ${{ needs.fetch-supported-versions.outputs.symfony-min }}
240+ # Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317)
241+ pkg-extra-constraints : behat/gherkin:~4.12.0
242+ - job-name : Symfony - With highest supported PHP version
243+ php-version : ${{ needs.fetch-supported-versions.outputs.php-max }}
244+ symfony-version : ${{ needs.fetch-supported-versions.outputs.symfony-next }}
245+ # Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317)
246+ # Fix - symfony/framework-bundle - Framework bundle <7.0 require php 8.1 minimum !
247+ 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' || '' }}
248+ - job-name : Symfony - With lowest supported PHP version
249+ # Fix - Sf 7.0 require php 8.1 minimum, most of deps require 8.2 !
250+ 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 }}
251+ symfony-version : ${{ needs.fetch-supported-versions.outputs.symfony-next }}
252+ # Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317)
253+ # Fix - symfony/framework-bundle - Framework bundle <7.0 require php 8.1 minimum !
254+ 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' || '' }}
255+
256+ steps :
257+ - name : Check out code
258+ uses : actions/checkout@v5
259+
260+ - name : Setup PHP ${{ matrix.php-version }}
261+ id : setup-php
262+ uses : shivammathur/setup-php@v2
263+ env :
264+ update : true # whether to use latest available patch for the version or not
265+ fail-fast : true # step will fail if an extension or tool fails to set up
266+ with :
267+ php-version : ${{ matrix.php-version }}
268+ tools : composer
269+ coverage : none
270+
271+ - name : Get composer cache directory
272+ id : composer-cache
273+ run : echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
274+
275+ - name : Setup cache for PHP ${{ steps.setup-php.outputs.php-version }} & Symfony ${{ matrix.symfony-version }}
276+ uses : actions/cache@v4
277+ with :
278+ path : |
279+ ${{ steps.composer-cache.outputs.dir }}
280+ # Clear the cache if composer.json (as composer.lock is not available) has been updated
281+ key : tests-php${{ steps.setup-php.outputs.php-version }}-sf${{ matrix.symfony-version }}-${{ hashFiles('composer.json') }}
282+
283+ - name : Build with PHP ${{ steps.setup-php.outputs.php-version }} & Symfony ${{ matrix.symfony-version }}
284+ run : |
285+ SF_CONSTRAINT="~${{ matrix.symfony-version }}.0@dev"
286+ composer config minimum-stability dev \
287+ && composer require -W \
288+ symfony/config:${SF_CONSTRAINT} \
289+ symfony/dependency-injection:${SF_CONSTRAINT} \
290+ symfony/event-dispatcher:${SF_CONSTRAINT} \
291+ symfony/http-foundation:${SF_CONSTRAINT} \
292+ symfony/http-kernel:${SF_CONSTRAINT} \
293+ ${{ matrix.pkg-extra-constraints }} \
294+ && make build
295+
296+ - name : Test
297+ run : make test-unit && make test-functional
0 commit comments