@@ -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,210 +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
- && composer update ${{ env.COMPOSER_OPTIONS }} ${{ matrix.composer-flag }} \
91
- && make build
92
-
93
- - name : Tests
94
- run : make test-unit && make test-functional
95
-
96
- - name : Create "unit tests" reports group
97
- if : ${{ env.COVERAGE_TYPE == 'xdebug' }}
98
- id : unit-tests-coverage-group
99
- uses : yoanm/temp-reports-group-workspace/.github/actions/create-action@develop
100
- with :
101
- name : unit-tests
102
- format : clover
103
- files : build/coverage-phpunit/unit.clover
104
- flags : |
105
- unit-tests
106
- php-${{ matrix.php-version }}
107
- sf-${{ matrix.symfony-version }}
108
- path : build/coverage-groups
109
-
110
- - name : Create "functional tests" coverage group
111
- if : ${{ env.COVERAGE_TYPE == 'xdebug' }}
112
- id : functional-tests-coverage-group
113
- uses : yoanm/temp-reports-group-workspace/.github/actions/create-action@develop
114
- with :
115
- name : functional-tests
116
- format : clover
117
- files : |
118
- build/coverage-phpunit/functional.clover
119
- build/coverage-behat/clover.xml
120
- flags : |
121
- functional-tests
122
- php-${{ matrix.php-version }}
123
- sf-${{ matrix.symfony-version }}
124
- path : build/coverage-groups
125
-
126
- - name : Upload coverage reports
127
- if : ${{ env.COVERAGE_TYPE == 'xdebug' }}
128
- uses : actions/upload-artifact@v4
129
- with :
130
- name : coverage-groups-php${{ matrix.php-version }}-sf${{ matrix.symfony-version }}
131
- path : build/coverage-groups
132
- if-no-files-found : error
133
-
134
- static-checks :
135
- name : Static checks
136
- runs-on : ubuntu-latest
137
- steps :
138
- - uses : actions/checkout@v4
139
-
140
- - name : Setup PHP 8.2
141
- uses : shivammathur/setup-php@v2
142
- with :
143
- php-version : 8.2 # Latest supported
144
- tools : composer
145
- coverage : none
146
- env :
147
- # Always use latest available patch for the version
148
- update : true
149
-
150
- - name : Setup cache
151
- id : cache
152
- uses : actions/cache@v4
153
- with :
154
- path : |
155
- ~/.composer
156
- # Clear the cache if composer json (as composer.lock is in the repo) has been updated
157
- key : tests-${{ env.PHP_VERSION }}-${{ hashFiles('composer.json') }}
158
-
159
- - name : Build
160
- run : make build
161
-
162
- - name : ComposerRequireChecker
163
- uses : docker://webfactory/composer-require-checker:4.5.0
164
-
165
- - name : Dependencies check
166
- if : ${{ github.event_name == 'pull_request' }}
167
- uses : actions/dependency-review-action@v4
168
-
169
- nightly-tests :
170
- name : Nightly - Symfony ${{ matrix.symfony-version }}
171
- runs-on : ubuntu-latest
172
- env :
173
- COMPOSER_OPTIONS : ' --optimize-autoloader --ignore-platform-req=php+'
174
- continue-on-error : true
175
- needs : [ static-checks, tests ]
176
- strategy :
177
- fail-fast : false
178
- max-parallel : 4
179
- matrix :
180
- php-version :
181
- - ' 8.3' # Current php dev version
182
- symfony-version :
183
- - ' 4.4' # Lowest LTS
184
- - ' 5.4' # Latest LTS
185
- - ' 6.0' # Current major version
186
- include :
187
- - symfony-version : ' 6.3' # Next symfony minor version to manage with latest supported PHP version
188
- php-version : ' 8.2'
189
-
190
- steps :
191
- - name : Check out code
192
- uses : actions/checkout@v4
193
-
194
- - name : Setup PHP ${{ matrix.php-version }}
195
- uses : shivammathur/setup-php@v2
196
- with :
197
- php-version : ' ${{ matrix.php-version }}'
198
- tools : composer
199
- coverage : none
200
- env :
201
- # Always use latest available patch for the version
202
- update : true
203
-
204
- - name : Setup cache
205
- id : cache
206
- uses : actions/cache@v4
207
- with :
208
- path : |
209
- ~/.composer
210
- ./vendor
211
- # Clear the cache if composer json (as composer.lock is in the repo) has been updated
212
- key : tests-${{ matrix.php-version }}-${{ matrix.symfony-version }}-${{ hashFiles('composer.json') }}
213
-
214
- - name : Build
215
- run : |
216
- composer config minimum-stability dev \
217
- && composer require -W ${{ env.COMPOSER_OPTIONS }} \
218
- symfony/validator:^${{ matrix.symfony-version }} \
219
- && composer update ${{ env.COMPOSER_OPTIONS }} \
220
- && make build
221
-
222
- - name : Test
223
- 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