@@ -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,84 @@ 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+ env :
226+ COMPOSER_IGNORE_PLATFORM_REQ : ' php+'
227+ strategy :
228+ fail-fast : false
229+ matrix :
230+ include :
231+ - job-name : PHP - With highest supported Symfony versions
232+ php-version : ${{ needs.fetch-supported-versions.outputs.php-next }}
233+ symfony-version : ${{ needs.fetch-supported-versions.outputs.symfony-max }}
234+ # Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317)
235+ pkg-extra-constraints : behat/gherkin:~4.12.0
236+ - job-name : PHP - With lowest supported Symfony versions
237+ php-version : ${{ needs.fetch-supported-versions.outputs.php-next }}
238+ symfony-version : ${{ needs.fetch-supported-versions.outputs.symfony-min }}
239+ # Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317)
240+ pkg-extra-constraints : behat/gherkin:~4.12.0
241+ - job-name : Symfony - With highest supported PHP version
242+ php-version : ${{ needs.fetch-supported-versions.outputs.php-max }}
243+ symfony-version : ${{ needs.fetch-supported-versions.outputs.symfony-next }}
244+ # Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317)
245+ # Fix - symfony/framework-bundle - Framework bundle <7.0 require php 8.1 minimum !
246+ 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' || '' }}
247+ - job-name : Symfony - With lowest supported PHP version
248+ # Fix - Sf 7.0 require php 8.1 minimum, most of deps require 8.2 !
249+ 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 }}
250+ symfony-version : ${{ needs.fetch-supported-versions.outputs.symfony-next }}
251+ # Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317)
252+ # Fix - symfony/framework-bundle - Framework bundle <7.0 require php 8.1 minimum !
253+ 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' || '' }}
254+
255+ steps :
256+ - name : Check out code
257+ uses : actions/checkout@v5
258+
259+ - name : Setup PHP ${{ matrix.php-version }}
260+ id : setup-php
261+ uses : shivammathur/setup-php@v2
262+ env :
263+ update : true # whether to use latest available patch for the version or not
264+ fail-fast : true # step will fail if an extension or tool fails to set up
265+ with :
266+ php-version : ${{ matrix.php-version }}
267+ tools : composer
268+ coverage : none
269+
270+ - name : Get composer cache directory
271+ id : composer-cache
272+ run : echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
273+
274+ - name : Setup cache for PHP ${{ steps.setup-php.outputs.php-version }} & Symfony ${{ matrix.symfony-version }}
275+ uses : actions/cache@v4
276+ with :
277+ path : |
278+ ${{ steps.composer-cache.outputs.dir }}
279+ # Clear the cache if composer.json (as composer.lock is not available) has been updated
280+ key : tests-php${{ steps.setup-php.outputs.php-version }}-sf${{ matrix.symfony-version }}-${{ hashFiles('composer.json') }}
281+
282+ - name : Build with PHP ${{ steps.setup-php.outputs.php-version }} & Symfony ${{ matrix.symfony-version }}
283+ run : |
284+ SF_CONSTRAINT="~${{ matrix.symfony-version }}.0@dev"
285+ composer config minimum-stability dev \
286+ && composer require -W \
287+ symfony/config:${SF_CONSTRAINT} \
288+ symfony/dependency-injection:${SF_CONSTRAINT} \
289+ symfony/event-dispatcher:${SF_CONSTRAINT} \
290+ symfony/http-foundation:${SF_CONSTRAINT} \
291+ symfony/http-kernel:${SF_CONSTRAINT} \
292+ ${{ matrix.pkg-extra-constraints }} \
293+ && make build
294+
295+ - name : Test
296+ run : make test-unit && make test-functional
0 commit comments