@@ -2,49 +2,39 @@ name: 'CI reusable workflow'
2
2
3
3
on :
4
4
workflow_call :
5
- inputs :
6
- # >>>> Dummy env-inputs
7
- # Goal here is just to have access to variable values
8
- # in order to build job matrix as `env` variable is not available there
9
- php-min-version :
10
- default : ' 8.0'
11
- description : Lowest PHP version to assess (e.g Lowest supported version including security support)
12
- required : false
13
- type : string
14
- php-max-version :
15
- default : ' 8.4'
16
- description : Highest PHP version to assess (e.g Highest supported version)
17
- required : false
18
- type : string
19
- php-next-version :
20
- default : ' 8.5'
21
- description : Next (currently not supported) PHP version to assess (e.g Current dev version)
22
- required : false
23
- type : string
24
- symfony-min-version :
25
- default : ' 4.4'
26
- description : Lowest Symfony version to assess (e.g Lowest supported version - usually LTS including security support)
27
- required : false
28
- type : string
29
- symfony-max-version :
30
- default : ' 6.4'
31
- description : Highest Symfony version to assess (e.g Highest supported version)
32
- required : false
33
- type : string
34
- symfony-next-version :
35
- default : ' 7.0'
36
- description : Next (currently not supported) Symfony version to assess (e.g Current dev version)
37
- required : false
38
- type : string
39
- # <<<< Dummy env-inputs
40
5
41
6
env :
42
7
COMPOSER_PREFER_STABLE : ' 1'
43
8
TEST_OUTPUT_STYLE : pretty
44
9
45
10
jobs :
11
+ fetch-supported-versions :
12
+ name : Fetch supported versions
13
+ runs-on : ubuntu-latest
14
+ outputs :
15
+ php-min : ${{ steps.fetch-php-versions.outputs.min }}
16
+ php-max : ${{ steps.fetch-php-versions.outputs.max }}
17
+ php-next : ${{ steps.fetch-php-versions.outputs.next }}
18
+ symfony-min : ${{ steps.fetch-symfony-versions.outputs.min }}
19
+ symfony-max : ${{ steps.fetch-symfony-versions.outputs.max }}
20
+ symfony-next : ${{ steps.fetch-symfony-versions.outputs.next }}
21
+ steps :
22
+ - name : Fetch PHP supported versions
23
+ id : fetch-php-versions
24
+ uses : yoanm/gha-supported-versions-parser@feature/init
25
+ with :
26
+ dependency : php
27
+ path : .github/workflows/supported-versions.json
28
+ - name : Fetch Symfony supported versions
29
+ id : fetch-symfony-versions
30
+ uses : yoanm/gha-supported-versions-parser@feature/init
31
+ with :
32
+ dependency : symfony
33
+ path : .github/workflows/supported-versions.json
34
+
46
35
tests :
47
36
name : ${{ matrix.job-name }}
37
+ needs : [fetch-supported-versions]
48
38
runs-on : ubuntu-latest
49
39
env :
50
40
COVERAGE_TYPE : none
@@ -54,28 +44,28 @@ jobs:
54
44
matrix :
55
45
include :
56
46
- job-name : Up to date versions # => Highest versions allowed by composer config
57
- php-version : ' ${{ inputs. php-max-version }}'
58
- symfony-version : ' ${{ inputs. symfony-max-version }}'
47
+ php-version : ' ${{ needs.fetch-supported-versions.outputs. php-max }}'
48
+ symfony-version : ' ${{ needs.fetch-supported-versions.outputs. symfony-max }}'
59
49
# # Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317)
60
50
pkg-extra-constraints : behat/gherkin:~4.12.0
61
51
- job-name : Up to date versions - Special case - Symfony 5.4
62
- php-version : ' ${{ inputs. php-max-version }}'
52
+ php-version : ' ${{ needs.fetch-supported-versions.outputs. php-max }}'
63
53
symfony-version : ' 5.4'
64
54
# # Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317)
65
55
# Fix - symfony/yaml - Avoid issue with Sf YAML 6.4+ and Framework bundle
66
56
pkg-extra-constraints : behat/gherkin:~4.12.0 symfony/yaml:~6.4.0
67
57
- job-name : Bare minimum # => Lowest versions allowed by composer config
68
- php-version : ' ${{ inputs. php-min-version }}'
69
- symfony-version : ' ${{ inputs. symfony-min-version }}'
58
+ php-version : ' ${{ needs.fetch-supported-versions.outputs. php-min }}'
59
+ symfony-version : ' ${{ needs.fetch-supported-versions.outputs. symfony-min }}'
70
60
- job-name : Bare minimum - Special case - Symfony 5.4
71
- php-version : ' ${{ inputs. php-min-version }}'
61
+ php-version : ' ${{ needs.fetch-supported-versions.outputs. php-min }}'
72
62
symfony-version : ' 5.4'
73
63
- job-name : Late migration - PHP # => Highest symfony version with lowest php version allowed by composer config
74
- php-version : ${{ ( inputs. symfony-max-version == '6.4' && inputs. php-min-version == '8.0' ) && '8.1' || inputs. php-min-version }} # Fix - Sf 6.4 require php 8.1 minimum !
75
- symfony-version : ' ${{ inputs. symfony-max-version }}'
64
+ php-version : ${{ ( needs.fetch-supported-versions.outputs. symfony-max == '6.4' && needs.fetch-supported-versions.outputs. php-min == '8.0' ) && '8.1' || needs.fetch-supported-versions.outputs. php-min }} # Fix - Sf 6.4 require php 8.1 minimum !
65
+ symfony-version : ' ${{ needs.fetch-supported-versions.outputs. symfony-max }}'
76
66
- job-name : Late migration - Symfony # => Lowest symfony version with highest php version allowed by composer config
77
- php-version : ' ${{ inputs. php-max-version }}'
78
- symfony-version : ' ${{ inputs. symfony-min-version }}'
67
+ php-version : ' ${{ needs.fetch-supported-versions.outputs. php-max }}'
68
+ symfony-version : ' ${{ needs.fetch-supported-versions.outputs. symfony-min }}'
79
69
# Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317)
80
70
pkg-extra-constraints : behat/gherkin:~4.12.0
81
71
steps :
85
75
# Enable coverage only for specific version(s) !
86
76
# Usually highest version(s), plus additional ones in case of code used only with specific versions
87
77
- name : Enable coverage
88
- if : ${{ matrix.php-version == inputs. php-max-version }}
78
+ if : ${{ matrix.php-version == needs.fetch-supported-versions.outputs. php-max }}
89
79
run : |
90
80
echo "COVERAGE_TYPE=xdebug" >> $GITHUB_ENV
91
81
@@ -165,10 +155,11 @@ jobs:
165
155
166
156
static-checks :
167
157
name : Static analysis
158
+ needs : [fetch-supported-versions]
168
159
runs-on : ubuntu-latest
169
160
env :
170
- PHP_VERSION : ${{ inputs. php-max-version }}
171
- SYMFONY_VERSION : ${{ inputs. symfony-max-version }}
161
+ PHP_VERSION : ${{ needs.fetch-supported-versions.outputs. php-max }}
162
+ SYMFONY_VERSION : ${{ needs.fetch-supported-versions.outputs. symfony-max }}
172
163
steps :
173
164
- uses : actions/checkout@v5
174
165
@@ -215,38 +206,38 @@ jobs:
215
206
216
207
nightly-tests :
217
208
name : Nightly - ${{ matrix.job-name }}
209
+ needs : [ fetch-supported-versions, tests ]
218
210
runs-on : ubuntu-latest
211
+ continue-on-error : true
219
212
env :
220
213
COMPOSER_IGNORE_PLATFORM_REQ : ' php+'
221
- continue-on-error : true
222
- needs : [ tests ]
223
214
strategy :
224
215
fail-fast : false
225
216
matrix :
226
217
include :
227
218
- job-name : PHP - With highest supported Symfony versions
228
- php-version : ${{ inputs. php-next-version }}
229
- symfony-version : ${{ inputs. symfony-max-version }}
219
+ php-version : ${{ needs.fetch-supported-versions.outputs. php-next }}
220
+ symfony-version : ${{ needs.fetch-supported-versions.outputs. symfony-max }}
230
221
# Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317)
231
222
pkg-extra-constraints : behat/gherkin:~4.12.0
232
223
- job-name : PHP - With lowest supported Symfony versions
233
- php-version : ${{ inputs. php-next-version }}
234
- symfony-version : ${{ inputs. symfony-min-version }}
224
+ php-version : ${{ needs.fetch-supported-versions.outputs. php-next }}
225
+ symfony-version : ${{ needs.fetch-supported-versions.outputs. symfony-min }}
235
226
# Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317)
236
227
pkg-extra-constraints : behat/gherkin:~4.12.0
237
228
- job-name : Symfony - With highest supported PHP version
238
- php-version : ${{ inputs. php-max-version }}
239
- symfony-version : ${{ inputs. symfony-next-version }}
229
+ php-version : ${{ needs.fetch-supported-versions.outputs. php-max }}
230
+ symfony-version : ${{ needs.fetch-supported-versions.outputs. symfony-next }}
240
231
# Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317)
241
232
# Fix - symfony/framework-bundle - Framework bundle <7.0 require php 8.1 minimum !
242
- pkg-extra-constraints : behat/gherkin:~4.12.0 ${{ ( inputs. symfony-next-version == '7.0' && inputs. php-max-version == '8.4' ) && 'symfony/framework-bundle:~7.0.0@dev' || '' }}
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' || '' }}
243
234
- job-name : Symfony - With lowest supported PHP version
244
235
# Fix - Sf 7.0 require php 8.1 minimum, most of deps require 8.2 !
245
- php-version : ${{ ( inputs. symfony-next-version == '7.0' && inputs. php-min-version == '8.0' ) && '8.2' || inputs. php-min-version }}
246
- symfony-version : ${{ inputs. symfony-next-version }}
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 }}
247
238
# Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317)
248
239
# Fix - symfony/framework-bundle - Framework bundle <7.0 require php 8.1 minimum !
249
- pkg-extra-constraints : behat/gherkin:~4.12.0 ${{ ( inputs. symfony-next-version == '7.0' && inputs. php-min-version == '8.0' ) && 'symfony/framework-bundle:~7.0.0@dev' || '' }}
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' || '' }}
250
241
251
242
steps :
252
243
- name : Check out code
0 commit comments