-
Notifications
You must be signed in to change notification settings - Fork 8
466 lines (457 loc) · 17.4 KB
/
Copy pathci.yml
File metadata and controls
466 lines (457 loc) · 17.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
name: CI
on:
push:
branches:
- '*'
- '!v1'
pull_request:
branches-ignore:
- v1
env:
COMPOSER_ALLOW_SUPERUSER: '1' # https://getcomposer.org/doc/03-cli.md#composer-allow-superuser
COVERAGE: '0'
INFECTION_VERSION: '0.29.14'
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
php-cs-fixer:
name: PHP-CS-Fixer (PHP ${{ matrix.php }})
runs-on: ubuntu-latest
strategy:
matrix:
php:
- '8.5'
fail-fast: false
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: intl, bcmath, curl, openssl, mbstring, gd
ini-values: memory_limit=-1
tools: pecl, composer, php-cs-fixer
coverage: none
- name: Run PHP-CS-Fixer fix
run: php-cs-fixer fix --dry-run --diff --ansi --allow-unsupported-php-version 8.5
phpunit:
name: PHPUnit (Symfony ${{ matrix.symfony }}) (PHP ${{ matrix.php }})
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
php:
- '8.5'
symfony:
- '7.4'
- '8.1'
experimental:
- false
include:
- php: '8.5'
symfony: '7.4'
experimental: false
coverage: true
fail-fast: false
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
env:
GD_CONFIGURE_OPTS: --enable-gd=shared,/usr --with-external-gd --with-jpeg --with-freetype
GD_LIBS: libjpeg-dev libpng-dev
GD_PATH: ext/gd
with:
php-version: ${{ matrix.php }}
tools: pecl, composer
extensions: intl, bcmath, curl, openssl, mbstring, pdo_sqlite, exif, xsl, gd
coverage: pcov
ini-values: memory_limit=-1
- name: Get composer cache directory
id: composercache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-
- name: Enable code coverage
if: matrix.coverage
run: echo "COVERAGE=1" >> $GITHUB_ENV
- name: Disable deprecations helper
if: ${{ !matrix.coverage }}
run: echo "SYMFONY_DEPRECATIONS_HELPER=disabled=1" >> $GITHUB_ENV
- name: Update project dependencies
run: |
composer config extra.symfony.require ${{ matrix.symfony }}
composer update --no-progress --ansi
- name: Install PHPUnit
run: vendor/bin/simple-phpunit --version
- name: Clear test app cache
run: tests/Functional/app/bin/console cache:clear --ansi
- name: Run PHPUnit tests
run: |
mkdir -p build/logs/phpunit
if [ "$COVERAGE" = '1' ]; then
vendor/bin/simple-phpunit --configuration=phpunit.coverage.xml.dist --coverage-xml=build/logs/phpunit/coverage-xml --coverage-clover=build/logs/phpunit/clover.xml --log-junit=build/logs/phpunit/junit.xml
else
vendor/bin/simple-phpunit --log-junit build/logs/phpunit/junit.xml
fi
- name: Upload test artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: phpunit-logs-php${{ matrix.php }}-symfony${{ matrix.symfony }}
path: build/logs/phpunit
continue-on-error: true
- name: Upload coverage results to Codecov
if: matrix.coverage
uses: codecov/codecov-action@v4
with:
flags: phpunit
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
- name: Run Infection Mutation Tests
if: matrix.coverage
env: # Or as an environment variable
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
run: |
wget https://github.com/infection/infection/releases/download/$INFECTION_VERSION/infection.phar
wget https://github.com/infection/infection/releases/download/$INFECTION_VERSION/infection.phar.asc
gpg --keyserver keyserver.ubuntu.com --recv-keys C6D76C329EBADE2FB9C458CFC5095986493B4AA0
gpg --with-fingerprint --verify infection.phar.asc infection.phar
chmod +x infection.phar
./infection.phar --only-covered --coverage=build/logs/phpunit --min-covered-msi=90 --threads=30
- name: Upload Infection Mutation Logs
if: matrix.coverage
uses: actions/upload-artifact@v4
with:
name: infection-logs-php${{ matrix.php }}
path: infection.log
behat:
name: Behat (Symfony ${{ matrix.symfony }}) (PHP ${{ matrix.php }})
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
php:
- '8.5'
symfony:
- '7.4'
- '8.1'
experimental:
- false
include:
- php: '8.5'
symfony: '7.4'
experimental: false
coverage: true
fail-fast: false
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
env:
GD_CONFIGURE_OPTS: --enable-gd=shared,/usr --with-external-gd --with-jpeg --with-freetype
GD_LIBS: libjpeg-dev libpng-dev
GD_PATH: ext/gd
with:
php-version: ${{ matrix.php }}
tools: pecl, composer
extensions: intl, bcmath, curl, openssl, mbstring, pdo_sqlite, exif, xsl, gd
coverage: pcov
ini-values: memory_limit=-1
- name: Get Composer Cache Directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Restore composer cache
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: composer-php${{ matrix.php }}-${{ hashFiles('**/composer.json') }}
restore-keys: |
composer-php${{ matrix.php }}-
continue-on-error: true
- name: Update project dependencies
run: |
composer config extra.symfony.require ${{ matrix.symfony }}
composer update --no-progress --ansi
- name: Clear test app cache
run: tests/Functional/app/bin/console cache:clear --ansi
- name: Enable code coverage
if: matrix.coverage
run: echo "COVERAGE=1" >> $GITHUB_ENV
- name: Run Behat tests
run: |
mkdir -p build/logs/behat
if [ "$COVERAGE" = '1' ]; then
php -d memory_limit=-1 -d error_reporting="E_ALL & ~E_NOTICE & ~E_DEPRECATED" vendor/bin/behat --format=progress --out=std --format=junit --out=build/logs/behat/junit --profile=default-coverage --no-interaction --colors --tags='~@wip'
else
php -d memory_limit=-1 -d error_reporting="E_ALL & ~E_NOTICE & ~E_DEPRECATED" vendor/bin/behat --format=progress --out=std --format=junit --out=build/logs/behat/junit --profile=default --no-interaction --colors --tags='~@wip'
fi
- name: Merge code coverage reports
if: matrix.coverage
run: |
wget -qO /usr/local/bin/phpcov https://phar.phpunit.de/phpcov.phar
chmod +x /usr/local/bin/phpcov
phpcov merge --clover build/logs/behat/clover.xml build/coverage
continue-on-error: true
- name: Upload test artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: behat-logs-php${{ matrix.php }}-symfony${{ matrix.symfony }}
path: build/logs/behat
continue-on-error: true
- name: Upload coverage results to Codecov
if: matrix.coverage
uses: codecov/codecov-action@v4
with:
flags: behat
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
phpunit-lowest-deps:
name: PHPUnit (Symfony ${{ matrix.symfony }}) (PHP ${{ matrix.php }}) (lowest dependencies)
runs-on: ubuntu-latest
strategy:
matrix:
php:
- '8.5'
symfony:
- '^7.4'
fail-fast: false
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
env:
GD_CONFIGURE_OPTS: --enable-gd=shared,/usr --with-external-gd --with-jpeg --with-freetype
GD_LIBS: libjpeg-dev libpng-dev
GD_PATH: ext/gd
with:
php-version: ${{ matrix.php }}
tools: pecl, composer
extensions: intl, bcmath, curl, openssl, mbstring, pdo_sqlite, exif, xsl, gd
coverage: none
ini-values: memory_limit=-1
- name: Get Composer Cache Directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Restore composer cache
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: composer-lowest-deps-php${{ matrix.php }}-${{ hashFiles('**/composer.json') }}
restore-keys: |
composer-lowest-deps-php${{ matrix.php }}-
continue-on-error: true
- name: Update project dependencies
run: composer update --no-progress --ansi --prefer-stable --prefer-lowest
- name: Clear test app cache
run: tests/Functional/app/bin/console cache:clear --ansi
- name: Disable deprecations helper
run: echo "SYMFONY_DEPRECATIONS_HELPER=disabled=1" >> $GITHUB_ENV
- name: Run PHPUnit tests
run: |
mkdir -p build/logs/phpunit
vendor/bin/simple-phpunit --log-junit build/logs/phpunit/junit.xml
- name: Upload test artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: phpunit-logs-php${{ matrix.php }}-lowest-deps
path: build/logs/phpunit
continue-on-error: true
behat-lowest-deps:
name: Behat (Symfony ${{ matrix.symfony }}) (PHP ${{ matrix.php }}) (lowest dependencies)
runs-on: ubuntu-latest
strategy:
matrix:
php:
- '8.5'
symfony:
- '^7.4'
fail-fast: false
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
env:
GD_CONFIGURE_OPTS: --enable-gd=shared,/usr --with-external-gd --with-jpeg --with-freetype
GD_LIBS: libjpeg-dev libpng-dev
GD_PATH: ext/gd
with:
php-version: ${{ matrix.php }}
tools: pecl, composer
extensions: intl, bcmath, curl, openssl, mbstring, pdo_sqlite, exif, xsl, gd
coverage: none
ini-values: memory_limit=-1
- name: Get Composer Cache Directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Restore composer cache
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: composer-lowest-deps-php${{ matrix.php }}-${{ hashFiles('**/composer.json') }}
restore-keys: |
composer-lowest-deps-php${{ matrix.php }}-
continue-on-error: true
- name: Update project dependencies
run: composer update --no-progress --ansi --prefer-stable --prefer-lowest
- name: Clear test app cache
run: tests/Functional/app/bin/console cache:clear --ansi
- name: Run Behat tests
run: |
mkdir -p build/logs/behat
php -d memory_limit=-1 -d error_reporting="E_ALL & ~E_NOTICE & ~E_DEPRECATED" vendor/bin/behat --format=progress --out=std --format=junit --out=build/logs/behat/junit --profile=default --no-interaction --colors --tags='~@wip'
- name: Upload test artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: behat-logs-php${{ matrix.php }}-lowest-deps
path: build/logs/behat
continue-on-error: true
phpunit-symfony-next:
name: PHPUnit (Symfony NEXT ${{ matrix.symfony }}) (PHP ${{ matrix.php }})
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
php:
- '8.5'
symfony:
- '8.2'
fail-fast: false
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
env:
GD_CONFIGURE_OPTS: --enable-gd=shared,/usr --with-external-gd --with-jpeg --with-freetype
GD_LIBS: libjpeg-dev libpng-dev
GD_PATH: ext/gd
with:
php-version: ${{ matrix.php }}
tools: pecl, composer
extensions: intl, bcmath, curl, openssl, mbstring, pdo_sqlite, exif, xsl, gd
coverage: none
ini-values: memory_limit=-1
- name: Get Composer Cache Directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Restore composer cache
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: composer-php${{ matrix.php }}-${{ hashFiles('**/composer.json') }}
restore-keys: |
composer-php${{ matrix.php }}-symfony${{ matrix.symfony }}-
composer-php${{ matrix.php }}-
composer-
continue-on-error: true
- name: Update project dependencies
run: |
composer config extra.symfony.require ${{ matrix.symfony }}
composer config minimum-stability dev
composer config prefer-stable false
composer update --no-progress --ansi
- name: Flag held back Symfony packages
env:
symfony_version: ${{ matrix.symfony }}
run: |
version_pattern=$symfony_version.x-dev
if [ "${symfony_version%.4}" != "$symfony_version" ]; then
current_major=${symfony_version%.4}
next_major=$((current_major + 1))
version_pattern=$version_pattern'|'$next_major.0.x-dev'|'dev-main
fi
version_pattern=$(echo "$version_pattern" | sed -r 's/\./\\./g')
symfony_packages=$(composer show symfony/* | tr -s ' ' '\t' | cut -f1-2 | grep -vE 'polyfill|contracts|mercure|debug|maker-bundle|monolog-bundle')
! echo "$symfony_packages" | grep -vE "$version_pattern"
continue-on-error: true
- name: Clear test app cache
run: tests/Functional/app/bin/console cache:clear --ansi
- name: Run PHPUnit tests
run: |
mkdir -p build/logs/phpunit
vendor/bin/simple-phpunit --log-junit build/logs/phpunit/junit.xml
- name: Upload test artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: phpunit-logs-php${{ matrix.php }}-symfony${{ matrix.symfony }}
path: build/logs/phpunit
continue-on-error: true
behat-symfony-next:
name: Behat (Symfony NEXT ${{ matrix.symfony }}) (PHP ${{ matrix.php }})
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
php:
- '8.5'
symfony:
- '8.2'
fail-fast: false
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
env:
GD_CONFIGURE_OPTS: --enable-gd=shared,/usr --with-external-gd --with-jpeg --with-freetype
GD_LIBS: libjpeg-dev libpng-dev
GD_PATH: ext/gd
with:
php-version: ${{ matrix.php }}
tools: pecl, composer
extensions: intl, bcmath, curl, openssl, mbstring, pdo_sqlite, exif, xsl, gd
coverage: none
ini-values: memory_limit=-1
- name: Get Composer Cache Directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Restore composer cache
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: composer-php${{ matrix.php }}-symfony${{ matrix.symfony }}-${{ github.sha }}
restore-keys: |
composer-php${{ matrix.php }}-symfony${{ matrix.symfony }}-
composer-php${{ matrix.php }}-
composer-
continue-on-error: true
- name: Update project dependencies
run: |
composer config extra.symfony.require ${{ matrix.symfony }}
composer config minimum-stability dev
composer config prefer-stable false
composer update --no-progress --ansi
- name: Clear test app cache
run: tests/Functional/app/bin/console cache:clear --ansi
- name: Run Behat tests
run: |
mkdir -p build/logs/behat
php -d memory_limit=-1 -d error_reporting="E_ALL & ~E_NOTICE & ~E_DEPRECATED" vendor/bin/behat --format=progress --out=std --format=junit --out=build/logs/behat/junit --profile=default --no-interaction --colors --tags='~@wip'
- name: Upload test artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: behat-logs-php${{ matrix.php }}-symfony${{ matrix.symfony }}
path: build/logs/behat
continue-on-error: true