@@ -17,7 +17,6 @@ concurrency:
17
17
env :
18
18
# Cache params
19
19
CACHE_VERSION : 2022061905 # To be able to create a new cache (YYYYMMDDXX)
20
- COVERAGE_OUTPUT_STYLE : clover
21
20
TEST_OUTPUT_STYLE : pretty
22
21
COMPOSER_OPTIONS : --optimize-autoloader
23
22
CODACY_CACHE_PATH : ~/.cache/codacy
35
34
with :
36
35
php-version : ' 8.1'
37
36
tools : composer
37
+ coverage : none
38
38
env :
39
39
# Always use latest available patch for the version
40
40
update : true
@@ -59,28 +59,44 @@ jobs:
59
59
uses : actions/dependency-review-action@v1
60
60
61
61
tests :
62
- name : UTs & FTs - PHP ${{ matrix.php-version }} / Symfony ${{ matrix.symfony-version }}
62
+ name : UTs & FTs - Symfony ${{ matrix.symfony-version }}
63
63
runs-on : ubuntu-latest
64
+ env :
65
+ COVERAGE_TYPE : none
64
66
strategy :
65
67
fail-fast : true
66
68
max-parallel : 4
67
69
matrix :
68
70
php-version :
69
71
- ' 7.3' # Lowest supported
72
+ - ' 7.4' # Latest php 7 version
73
+ - ' 8.0' # First php 8 version
70
74
- ' 8.1' # Latest supported
71
75
symfony-version :
72
76
- ' 4.4' # Lowest LTS
73
77
- ' 5.4' # Latest LTS
78
+ exclude :
79
+ # Run all symfony version only on Lowest and Latest php versions, run it only one time for others
80
+ - php-version : ' 8.0'
81
+ symfony-version : ' 4.4'
82
+ - php-version : ' 7.4'
83
+ symfony-version : ' 5.4'
74
84
steps :
75
85
- name : Check out code
76
86
uses : actions/checkout@v2
77
87
88
+ - name : Enable coverage
89
+ if : ${{ matrix.php-version == '8.1' }}
90
+ run : |
91
+ echo "COVERAGE_OUTPUT_STYLE=clover" >> $GITHUB_ENV
92
+ echo "COVERAGE_TYPE=xdebug" >> $GITHUB_ENV
93
+
78
94
- name : Setup PHP
79
95
uses : shivammathur/setup-php@v2
80
96
with :
81
97
php-version : ' ${{ matrix.php-version }}'
82
98
tools : composer
83
- coverage : xdebug
99
+ coverage : ${{ env.COVERAGE_TYPE }}
84
100
env :
85
101
# Always use latest available patch for the version
86
102
update : true
@@ -107,7 +123,7 @@ jobs:
107
123
108
124
- name : Build
109
125
run : |
110
- composer require \
126
+ composer require -W \
111
127
symfony/http-foundation:^${{ matrix.symfony-version }} \
112
128
symfony/http-kernel:^${{ matrix.symfony-version }} \
113
129
symfony/config:^${{ matrix.symfony-version }} \
@@ -121,13 +137,16 @@ jobs:
121
137
122
138
# See the reports at https://codecov.io/gh/yoanm/symfony-jsonrpc-http-server
123
139
- name : Upload unit tests coverage to codecov
140
+ if : ${{ env.COVERAGE_TYPE == 'xdebug' }}
124
141
uses : codecov/codecov-action@v3
125
142
with :
126
143
file : " build/coverage-phpunit/unit.clover"
127
144
name : " unit-tests-${{ matrix.php-version }}-${{ matrix.symfony-version }}"
128
145
flags : " unit-tests,php-${{ matrix.php-version }},sf-${{ matrix.symfony-version }}"
129
146
fail_ci_if_error : true
147
+
130
148
- name : Upload functional tests coverage to codecov
149
+ if : ${{ env.COVERAGE_TYPE == 'xdebug' }}
131
150
uses : codecov/codecov-action@v3
132
151
with :
133
152
files : " build/coverage-behat/clover.xml,build/coverage-phpunit/functional.clover"
@@ -136,6 +155,7 @@ jobs:
136
155
fail_ci_if_error : true
137
156
138
157
- name : Upload coverages to Codacy
158
+ if : ${{ env.COVERAGE_TYPE == 'xdebug' }}
139
159
run : ${{ env.CODACY_BIN }} report -r build/coverage-phpunit/unit.clover -r build/coverage-behat/clover.xml -r build/coverage-phpunit/functional.clover -t ${{ secrets.CODACY_PROJECT_TOKEN }} --partial
140
160
141
161
finalize-codacy-coverage-report :
@@ -162,77 +182,16 @@ jobs:
162
182
- name : Finalize reporting
163
183
run : ${{ env.CODACY_BIN }} final -t ${{ secrets.CODACY_PROJECT_TOKEN }}
164
184
165
- # Test against others impactful php versions (without coverage)
166
- tests-extra-versions :
167
- name : UTs & FTs - PHP ${{ matrix.php-version }} / Symfony ${{ matrix.symfony-version }}
168
- runs-on : ubuntu-latest
169
- needs : [ tests ]
170
- strategy :
171
- fail-fast : true
172
- max-parallel : 4
173
- matrix :
174
- include :
175
- - php-version : ' 7.4' # Latest php 7 version
176
- symfony-version : ' 4.4'
177
- - php-version : ' 8.0' # First php 8 version
178
- symfony-version : ' 5.4'
179
- steps :
180
- - name : Check out code
181
- uses : actions/checkout@v2
182
-
183
- - name : Setup PHP
184
- uses : shivammathur/setup-php@v2
185
- with :
186
- php-version : ' ${{ matrix.php-version }}'
187
- tools : composer
188
- env :
189
- # Always use latest available patch for the version
190
- update : true
191
-
192
- - name : Setup cache
193
- id : cache
194
- uses : actions/cache@v2
195
- with :
196
- path : |
197
- ~/.composer
198
- ./vendor
199
- ${{ env.CODACY_CACHE_PATH }}
200
- build/behat-code-coverage-cache
201
- # Clear the cache if composer json (as composer.lock is in the repo) has been updated
202
- key : ${{ env.CACHE_VERSION }}-tests-${{ matrix.php-version }}-${{ matrix.symfony-version }}-${{ hashFiles('composer.json') }}
203
-
204
- - name : Download codacy binary
205
- if : steps.cache.outputs.cache-hit != 'true'
206
- run : |
207
- mkdir -p ${{ env.CODACY_CACHE_PATH }} \
208
- && curl -LN https://coverage.codacy.com/get.sh -o ${{ env.CODACY_BIN }} \
209
- && chmod +x ${{ env.CODACY_BIN }} \
210
- && ${{ env.CODACY_BIN }} download
211
-
212
- - name : Build
213
- run : |
214
- composer require \
215
- symfony/http-foundation:^${{ matrix.symfony-version }} \
216
- symfony/http-kernel:^${{ matrix.symfony-version }} \
217
- symfony/config:^${{ matrix.symfony-version }} \
218
- symfony/dependency-injection:^${{ matrix.symfony-version }} \
219
- symfony/event-dispatcher:^${{ matrix.symfony-version }} \
220
- symfony/routing:^${{ matrix.symfony-version }} \
221
- && make build
222
-
223
- - name : Tests
224
- run : make test-unit && make test-functional
225
-
226
185
# Perform tests against current php dev version and next Symfony minor version to manage
227
186
nightly-tests :
228
- name : Nightly - PHP ${{ matrix.php-version }} / Symfony ${{ matrix.symfony-version }}
229
- needs : [ tests ]
187
+ name : Nightly - Symfony ${{ matrix.symfony-version }}
188
+ needs : [ static-tests, tests ]
230
189
runs-on : ubuntu-latest
231
190
env :
232
191
COMPOSER_OPTIONS : ' --optimize-autoloader --ignore-platform-req=php+'
233
192
strategy :
234
193
fail-fast : false
235
- max-parallel : 2
194
+ max-parallel : 4
236
195
matrix :
237
196
php-version :
238
197
- ' 8.2' # Current php dev version
@@ -252,7 +211,7 @@ jobs:
252
211
with :
253
212
php-version : ' ${{ matrix.php-version }}'
254
213
tools : composer
255
- coverage : xdebug
214
+ coverage : none
256
215
env :
257
216
# Always use latest available patch for the version
258
217
update : true
@@ -271,7 +230,7 @@ jobs:
271
230
272
231
- name : Build
273
232
run : |
274
- composer require ${COMPOSER_OPTIONS} \
233
+ composer require -W ${COMPOSER_OPTIONS} \
275
234
symfony/http-foundation:^${{ matrix.symfony-version }} \
276
235
symfony/http-kernel:^${{ matrix.symfony-version }} \
277
236
symfony/config:^${{ matrix.symfony-version }} \
@@ -282,20 +241,3 @@ jobs:
282
241
283
242
- name : Test
284
243
run : make test-unit && make test-functional
285
-
286
- # See the reports at https://codecov.io/gh/yoanm/symfony-jsonrpc-http-server
287
- - name : Upload unit tests coverage to codecov
288
- uses : codecov/codecov-action@v3
289
- with :
290
- file : " build/coverage-phpunit/unit.clover"
291
- name : " unit-tests-${{ matrix.php-version }}-${{ matrix.symfony-version }}"
292
- flags : " nightly,unit-tests,php-${{ matrix.php-version }},sf-${{ matrix.symfony-version }}"
293
- fail_ci_if_error : false
294
-
295
- - name : Upload functional tests coverage to codecov
296
- uses : codecov/codecov-action@v3
297
- with :
298
- files : " build/coverage-behat/clover.xml,build/coverage-phpunit/functional.clover"
299
- name : " functional-tests-${{ matrix.php-version }}-${{ matrix.symfony-version }}"
300
- flags : " nightly,functional-tests,php-${{ matrix.php-version }},sf-${{ matrix.symfony-version }}"
301
- fail_ci_if_error : false
0 commit comments