@@ -16,17 +16,11 @@ concurrency:
16
16
cancel-in-progress : true
17
17
18
18
env :
19
- # Cache params
20
- CACHE_VERSION : 2022061905 # To be able to create a new cache (YYYYMMDDXX)
21
19
TEST_OUTPUT_STYLE : pretty
22
20
COMPOSER_OPTIONS : --optimize-autoloader
23
21
CODACY_CACHE_PATH : ~/.cache/codacy
24
22
CODACY_BIN : ~/.cache/codacy/codacy.sh
25
23
26
-
27
- # permissions:
28
- # actions: write # Required to be able to trigger sub CI workflows
29
-
30
24
jobs :
31
25
tests :
32
26
name : UTs & FTs - Symfony ${{ matrix.symfony-version }}
@@ -37,26 +31,27 @@ jobs:
37
31
fail-fast : true
38
32
max-parallel : 4
39
33
matrix :
40
- php-version :
41
- - ' 8.1' # Latest supported
42
- - ' 8.0' # First php 8 version
43
- - ' 7.4' # Latest php 7 version
44
- - ' 7.3' # Lowest supported
45
- symfony-version :
46
- - ' 4.4' # Lowest LTS
47
- - ' 5.4' # Latest LTS
48
- exclude :
49
- # Run all symfony version only on Lowest and Latest php versions, run it only one time for others
50
- - php-version : ' 8.0'
51
- symfony-version : ' 4.4'
52
- - php-version : ' 7.4'
53
- symfony-version : ' 5.4'
34
+ include :
35
+ # Bare minimum => Lowest versions allowed by composer config
36
+ - symfony-version : ' 4.4'
37
+ php-version : ' 8.0'
38
+ composer-flag : --prefer-lowest
39
+ # Up to date versions => Latest versions allowed by composer config
40
+ - symfony-version : ' 5.4'
41
+ php-version : ' 8.2'
42
+ # Late symfony migration => Lowest symfony version with latest minor php version allowed by composer config
43
+ - symfony-version : ' 4.4'
44
+ php-version : ' 8.2'
45
+ composer-flag : --prefer-lowest
46
+ # Late php migration => Latest symfony version with lowest minor php version allowed by composer config
47
+ - symfony-version : ' 5.4'
48
+ php-version : ' 8.0'
54
49
steps :
55
50
- name : Check out code
56
51
uses : actions/checkout@v3
57
52
58
53
- name : Enable coverage
59
- if : ${{ matrix.php-version == '8.1 ' }}
54
+ if : ${{ matrix.php-version == '8.2 ' }}
60
55
run : |
61
56
echo "COVERAGE_OUTPUT_STYLE=clover" >> $GITHUB_ENV
62
57
echo "COVERAGE_TYPE=xdebug" >> $GITHUB_ENV
79
74
~/.composer
80
75
./vendor
81
76
${{ env.CODACY_CACHE_PATH }}
82
- build/behat-code-coverage-cache
83
77
# Clear the cache if composer json (as composer.lock is in the repo) has been updated
84
- key : ${{ env.CACHE_VERSION }}-tests- ${{ matrix.php -version }}-${{ matrix.symfony-version }}-${{ hashFiles('composer.json') }}
78
+ key : tests- ${{ matrix.php-version }}-${{ matrix.symfony -version }}-${{ matrix.composer-flag }}-${{ hashFiles('composer.json') }}
85
79
86
80
- name : Download codacy binary
87
81
if : steps.cache.outputs.cache-hit != 'true'
@@ -93,13 +87,17 @@ jobs:
93
87
94
88
- name : Build
95
89
run : |
96
- composer require -W \
97
- symfony/http-foundation:^${{ matrix.symfony-version }} \
98
- symfony/http-kernel:^${{ matrix.symfony-version }} \
99
- symfony/config:^${{ matrix.symfony-version }} \
100
- symfony/dependency-injection:^${{ matrix.symfony-version }} \
101
- symfony/event-dispatcher:^${{ matrix.symfony-version }} \
102
- symfony/routing:^${{ matrix.symfony-version }} \
90
+ SF_VERSION=${{ matrix.symfony-version }}
91
+ # Issue with ParamterBag below 4.4.30 => https://github.com/symfony/symfony/commit/3eca446b21607ea1c7a865ece2dd8254c33679cc
92
+ test '${{ matrix.symfony-version }}' = '4.4' && test '${{ matrix.php-version }}' = '8.2' && SF_VERSION=4.4.30
93
+ composer require -W ${{ env.COMPOSER_OPTIONS }} ${{ matrix.composer-flag }} \
94
+ symfony/http-foundation:^$SF_VERSION \
95
+ symfony/http-kernel:^$SF_VERSION \
96
+ symfony/config:^$SF_VERSION \
97
+ symfony/dependency-injection:^$SF_VERSION \
98
+ symfony/event-dispatcher:^$SF_VERSION \
99
+ symfony/routing:^$SF_VERSION \
100
+ && composer update ${{ env.COMPOSER_OPTIONS }} ${{ matrix.composer-flag }} \
103
101
&& make build
104
102
105
103
- name : Tests
@@ -108,7 +106,7 @@ jobs:
108
106
# Upload to codacy first as codecov action always remove coverage files despite move_coverage_to_trash at false
109
107
# And only if it's not a PR from a fork => Can't work as codacy secret is not accessible in that context
110
108
- name : Upload coverages to Codacy
111
- if : ${{ github.event.pull_request.head.repo.full_name == 'yoanm/symfony-jsonrpc-http-server' && env.COVERAGE_TYPE == 'xdebug' }}
109
+ if : ${{ ( github.event_name != 'pull_request' || github. event.pull_request.head.repo.full_name == 'yoanm/symfony-jsonrpc-http-server') && env.COVERAGE_TYPE == 'xdebug' }}
112
110
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
113
111
114
112
# See the reports at https://codecov.io/gh/yoanm/symfony-jsonrpc-http-server
@@ -141,10 +139,10 @@ jobs:
141
139
steps :
142
140
- uses : actions/checkout@v3
143
141
144
- - name : Setup PHP 8.1
142
+ - name : Setup PHP 8.2
145
143
uses : shivammathur/setup-php@v2
146
144
with :
147
- php-version : 8.1 # Latest supported
145
+ php-version : 8.2 # Latest supported
148
146
tools : composer
149
147
coverage : none
150
148
env :
@@ -158,7 +156,7 @@ jobs:
158
156
path : |
159
157
~/.composer
160
158
# Clear the cache if composer json (as composer.lock is in the repo) has been updated
161
- key : ${{ env.CACHE_VERSION }}- tests-${{ env.PHP_VERSION }}-${{ hashFiles('composer.json') }}
159
+ key : tests-${{ env.PHP_VERSION }}-${{ hashFiles('composer.json') }}
162
160
163
161
- name : Build
164
162
run : make build
@@ -173,7 +171,7 @@ jobs:
173
171
finalize-codacy-coverage-report :
174
172
runs-on : ubuntu-latest
175
173
name : Finalize Codacy coverage report
176
- if : ${{ github.event.pull_request.head.repo.full_name == 'yoanm/symfony-jsonrpc-http-server' }}
174
+ if : ${{ github.event_name != 'pull_request' || github. event.pull_request.head.repo.full_name == 'yoanm/symfony-jsonrpc-http-server' }}
177
175
needs : [ tests ]
178
176
steps :
179
177
- name : Setup cache
@@ -182,7 +180,7 @@ jobs:
182
180
with :
183
181
path : |
184
182
${{ env.CODACY_CACHE_PATH }}
185
- key : ${{ env.CACHE_VERSION }}- codacy-final
183
+ key : codacy-final
186
184
187
185
- name : Download codacy binary
188
186
if : steps.cache.outputs.cache-hit != 'true'
@@ -205,18 +203,15 @@ jobs:
205
203
strategy :
206
204
fail-fast : false
207
205
max-parallel : 4
208
- # Perform tests against:
209
- # - current php dev version with all supported symfony version
210
- # - next Symfony minor version to manage with latest supported php version
211
206
matrix :
212
207
php-version :
213
- - ' 8.2 ' # Current php dev version
208
+ - ' 8.3 ' # Current php dev version
214
209
symfony-version :
215
210
- ' 4.4' # Lowest LTS
216
211
- ' 5.4' # Latest LTS
217
212
include :
218
213
- symfony-version : ' 6.0' # Next symfony minor version to manage with latest supported PHP version
219
- php-version : ' 8.1 '
214
+ php-version : ' 8.2 '
220
215
221
216
steps :
222
217
- name : Check out code
@@ -240,7 +235,7 @@ jobs:
240
235
~/.composer
241
236
./vendor
242
237
# Clear the cache if composer json (as composer.lock is in the repo) has been updated
243
- key : ${{ env.CACHE_VERSION }}- tests-${{ matrix.php-version }}-${{ matrix.symfony-version }}-${{ hashFiles('composer.json') }}
238
+ key : tests-${{ matrix.php-version }}-${{ matrix.symfony-version }}-${{ hashFiles('composer.json') }}
244
239
245
240
- name : Build
246
241
run : |
@@ -251,6 +246,7 @@ jobs:
251
246
symfony/dependency-injection:^${{ matrix.symfony-version }} \
252
247
symfony/event-dispatcher:^${{ matrix.symfony-version }} \
253
248
symfony/routing:^${{ matrix.symfony-version }} \
249
+ && composer update ${{ env.COMPOSER_OPTIONS }} \
254
250
&& make build
255
251
256
252
- name : Test
0 commit comments