@@ -5,6 +5,14 @@ on: # Build any PRs and main branch changes
5
5
types :
6
6
- opened
7
7
- synchronize
8
+ paths-ignore :
9
+ # In case of updates to those workflows, they must be pre-checked by `pre-check-CI-updates.yml` rather than this workflow !
10
+ # Any updates on those workflows are expected to be restricted to those workflows only ! (no update on code for instance)
11
+ - ' .github/workflows/pre-check-CI-updates.yml'
12
+ - ' .github/workflows/CI.yml'
13
+ - ' .github/workflows/coverage-upload.yml'
14
+ - ' .github/workflows/reusable-CI-workflow.yml'
15
+ - ' .github/workflows/reusable-coverage-upload-workflow.yml'
8
16
push :
9
17
branches : [ master ]
10
18
schedule :
@@ -14,214 +22,9 @@ concurrency:
14
22
group : " ${{ github.workflow }}-${{ github.head_ref || github.ref }}"
15
23
cancel-in-progress : true
16
24
17
- env :
18
- TEST_OUTPUT_STYLE : pretty
19
- COMPOSER_OPTIONS : --optimize-autoloader
20
-
21
25
jobs :
22
26
tests :
23
- name : UTs & FTs - Symfony ${{ matrix.symfony-version }}
24
- runs-on : ubuntu-latest
25
- env :
26
- COVERAGE_TYPE : none
27
- strategy :
28
- fail-fast : true
29
- max-parallel : 4
30
- matrix :
31
- include :
32
- # Bare minimum => Lowest versions allowed by composer config
33
- - symfony-version : ' 4.4'
34
- php-version : ' 8.0'
35
- composer-flag : --prefer-lowest
36
- # Up to date versions => Latest versions allowed by composer config
37
- - symfony-version : ' 5.4'
38
- php-version : ' 8.2'
39
- # Late symfony migration => Lowest symfony version with latest minor php version allowed by composer config
40
- - symfony-version : ' 4.4'
41
- php-version : ' 8.2'
42
- composer-flag : --prefer-lowest
43
- # Late php migration => Latest symfony version with lowest minor php version allowed by composer config
44
- - symfony-version : ' 5.4'
45
- php-version : ' 8.0'
46
- # Symfony 6.0 latest
47
- - symfony-version : ' 6.0'
48
- php-version : ' 8.2'
49
- # Symfony 6.0 lowest
50
- - symfony-version : ' 6.0'
51
- php-version : ' 8.0'
52
- composer-flag : --prefer-lowest
53
- steps :
54
- - name : Check out code
55
- uses : actions/checkout@v4
56
-
57
- - name : Enable coverage
58
- if : ${{ matrix.php-version == '8.2' }}
59
- run : |
60
- echo "COVERAGE_OUTPUT_STYLE=clover" >> $GITHUB_ENV
61
- echo "COVERAGE_TYPE=xdebug" >> $GITHUB_ENV
62
-
63
- - name : Setup PHP ${{ matrix.php-version }}
64
- uses : shivammathur/setup-php@v2
65
- env :
66
- update : true # Always use latest available patch for the version
67
- fail-fast : true # step will fail if an extension or tool fails to set up
68
- with :
69
- php-version : ' ${{ matrix.php-version }}'
70
- tools : composer
71
- coverage : ${{ env.COVERAGE_TYPE }}
72
-
73
- - name : Setup cache
74
- id : cache
75
- uses : actions/cache@v4
76
- with :
77
- path : |
78
- ~/.composer
79
- ./vendor
80
- # Clear the cache if composer json (as composer.lock is in the repo) has been updated
81
- key : tests-${{ matrix.php-version }}-${{ matrix.symfony-version }}-${{ matrix.composer-flag }}-${{ hashFiles('composer.json') }}
82
-
83
- - name : Build
84
- run : |
85
- SF_VERSION=${{ matrix.symfony-version }}
86
- # Issue with ParamterBag below 4.4.30 => https://github.com/symfony/symfony/commit/3eca446b21607ea1c7a865ece2dd8254c33679cc
87
- test '${{ matrix.symfony-version }}' = '4.4' && test '${{ matrix.php-version }}' = '8.2' && SF_VERSION=4.4.30
88
- composer require -W ${{ env.COMPOSER_OPTIONS }} ${{ matrix.composer-flag }} \
89
- symfony/validator:^$SF_VERSION \
90
- symfony/intl:^$SF_VERSION \
91
- symfony/expression-language:^$SF_VERSION \
92
- && composer update ${{ env.COMPOSER_OPTIONS }} ${{ matrix.composer-flag }} \
93
- && make build
94
-
95
- - name : Tests
96
- run : make test-unit && make test-functional
97
-
98
- - name : Create "unit tests" reports group
99
- if : ${{ env.COVERAGE_TYPE == 'xdebug' }}
100
- id : unit-tests-coverage-group
101
- uses : yoanm/temp-reports-group-workspace/.github/actions/create-action@develop
102
- with :
103
- name : unit-tests
104
- format : clover
105
- files : build/coverage-phpunit/unit.clover
106
- flags : |
107
- unit-tests
108
- php-${{ matrix.php-version }}
109
- sf-${{ matrix.symfony-version }}
110
- path : build/coverage-groups
111
-
112
- - name : Create "functional tests" coverage group
113
- if : ${{ env.COVERAGE_TYPE == 'xdebug' }}
114
- id : functional-tests-coverage-group
115
- uses : yoanm/temp-reports-group-workspace/.github/actions/create-action@develop
116
- with :
117
- name : functional-tests
118
- format : clover
119
- files : |
120
- build/coverage-phpunit/functional.clover
121
- build/coverage-behat/clover.xml
122
- flags : |
123
- functional-tests
124
- php-${{ matrix.php-version }}
125
- sf-${{ matrix.symfony-version }}
126
- path : build/coverage-groups
127
-
128
- - name : Upload coverage reports
129
- if : ${{ env.COVERAGE_TYPE == 'xdebug' }}
130
- uses : actions/upload-artifact@v4
131
- with :
132
- name : coverage-groups-php${{ matrix.php-version }}-sf${{ matrix.symfony-version }}
133
- path : build/coverage-groups
134
- if-no-files-found : error
135
-
136
- static-checks :
137
- name : Static checks
138
- runs-on : ubuntu-latest
139
- steps :
140
- - uses : actions/checkout@v4
141
-
142
- - name : Setup PHP 8.2
143
- uses : shivammathur/setup-php@v2
144
- with :
145
- php-version : 8.2 # Latest supported
146
- tools : composer
147
- coverage : none
148
- env :
149
- # Always use latest available patch for the version
150
- update : true
151
-
152
- - name : Setup cache
153
- id : cache
154
- uses : actions/cache@v4
155
- with :
156
- path : |
157
- ~/.composer
158
- # Clear the cache if composer json (as composer.lock is in the repo) has been updated
159
- key : tests-${{ env.PHP_VERSION }}-${{ hashFiles('composer.json') }}
160
-
161
- - name : Build
162
- run : make build
163
-
164
- - name : ComposerRequireChecker
165
- uses : docker://webfactory/composer-require-checker:4.5.0
166
-
167
- - name : Dependencies check
168
- if : ${{ github.event_name == 'pull_request' }}
169
- uses : actions/dependency-review-action@v4
170
-
171
- nightly-tests :
172
- name : Nightly - Symfony ${{ matrix.symfony-version }}
173
- runs-on : ubuntu-latest
174
- env :
175
- COMPOSER_OPTIONS : ' --optimize-autoloader --ignore-platform-req=php+'
176
- continue-on-error : true
177
- needs : [ static-checks, tests ]
178
- strategy :
179
- fail-fast : false
180
- max-parallel : 4
181
- matrix :
182
- php-version :
183
- - ' 8.3' # Current php dev version
184
- symfony-version :
185
- - ' 4.4' # Lowest LTS
186
- - ' 5.4' # Latest LTS
187
- - ' 6.0' # Current major version
188
- include :
189
- - symfony-version : ' 6.3' # Next symfony minor version to manage with latest supported PHP version
190
- php-version : ' 8.2'
191
-
192
- steps :
193
- - name : Check out code
194
- uses : actions/checkout@v4
195
-
196
- - name : Setup PHP ${{ matrix.php-version }}
197
- uses : shivammathur/setup-php@v2
198
- with :
199
- php-version : ' ${{ matrix.php-version }}'
200
- tools : composer
201
- coverage : none
202
- env :
203
- # Always use latest available patch for the version
204
- update : true
205
-
206
- - name : Setup cache
207
- id : cache
208
- uses : actions/cache@v4
209
- with :
210
- path : |
211
- ~/.composer
212
- ./vendor
213
- # Clear the cache if composer json (as composer.lock is in the repo) has been updated
214
- key : tests-${{ matrix.php-version }}-${{ matrix.symfony-version }}-${{ hashFiles('composer.json') }}
215
-
216
- - name : Build
217
- run : |
218
- composer config minimum-stability dev \
219
- && composer require -W ${{ env.COMPOSER_OPTIONS }} \
220
- symfony/validator:^${{ matrix.symfony-version }} \
221
- symfony/intl:^${{ matrix.symfony-version }} \
222
- symfony/expression-language:^${{ matrix.symfony-version }} \
223
- && composer update ${{ env.COMPOSER_OPTIONS }} \
224
- && make build
225
-
226
- - name : Test
227
- run : make test-unit && make test-functional
27
+ name : Tests
28
+ permissions :
29
+ contents : read
30
+ uses : ./.github/workflows/reusable-CI-workflow.yml
0 commit comments