|
7 | 7 | COMPOSER_PREFER_STABLE: '1'
|
8 | 8 | TEST_OUTPUT_STYLE: pretty
|
9 | 9 |
|
10 |
| - |
11 |
| -permissions: |
12 |
| - contents: read |
13 |
| - |
14 | 10 | jobs:
|
15 | 11 | fetch-supported-versions:
|
16 | 12 | name: Fetch supported versions
|
17 | 13 | runs-on: ubuntu-latest
|
18 |
| - permissions: |
19 |
| - contents: read |
20 | 14 | outputs:
|
21 | 15 | php-min: ${{ steps.fetch-php-versions.outputs.min }}
|
22 | 16 | php-max: ${{ steps.fetch-php-versions.outputs.max }}
|
|
31 | 25 | with:
|
32 | 26 | dependency: php
|
33 | 27 | path: .github/workflows/supported-versions.json
|
34 |
| - |
35 | 28 | - name: Fetch Symfony supported versions
|
36 | 29 | id: fetch-symfony-versions
|
37 | 30 | uses: yoanm/gha-supported-versions-parser@feature/init
|
|
43 | 36 | name: ${{ matrix.job-name }}
|
44 | 37 | needs: [fetch-supported-versions]
|
45 | 38 | runs-on: ubuntu-latest
|
46 |
| - permissions: |
47 |
| - contents: read |
48 | 39 | env:
|
49 | 40 | COVERAGE_TYPE: none
|
50 | 41 | COVERAGE_OUTPUT_STYLE: clover
|
@@ -166,8 +157,6 @@ jobs:
|
166 | 157 | name: Static analysis
|
167 | 158 | needs: [fetch-supported-versions]
|
168 | 159 | runs-on: ubuntu-latest
|
169 |
| - permissions: |
170 |
| - contents: read |
171 | 160 | env:
|
172 | 161 | PHP_VERSION: ${{ needs.fetch-supported-versions.outputs.php-max }}
|
173 | 162 | SYMFONY_VERSION: ${{ needs.fetch-supported-versions.outputs.symfony-max }}
|
@@ -214,3 +203,81 @@ jobs:
|
214 | 203 | - name: Dependencies check
|
215 | 204 | if: ${{ github.event_name == 'pull_request' }}
|
216 | 205 | 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 |
0 commit comments