@@ -10,28 +10,9 @@ concurrency:
10
10
11
11
env :
12
12
COMPOSER_TOKEN : ${{ secrets.GITHUB_TOKEN }}
13
+ COMPOSER_ROOT_VERSION : " 4.1.x-dev"
13
14
14
15
jobs :
15
- commitlint :
16
- if : github.event_name == 'pull_request'
17
- env :
18
- GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
19
- runs-on : ubuntu-latest
20
- steps :
21
- - uses : actions/checkout@v4
22
- with :
23
- fetch-depth : 0
24
- - name : Run commitlint
25
- run : |
26
- commit=$(gh api \
27
- /repos/${{ github.repository }}/pulls/${{github.event.number}}/commits \
28
- | jq -r '.[0].commit.message' \
29
- | head -n 1)
30
- # we can't use npx see https://github.com/conventional-changelog/commitlint/issues/613
31
- echo '{}' > package.json
32
- npm install --no-fund --no-audit @commitlint/config-conventional @commitlint/cli
33
- echo $commit | ./node_modules/.bin/commitlint -g .commitlintrc
34
-
35
16
architecture :
36
17
name : Check components interdependencies
37
18
runs-on : ubuntu-latest
@@ -264,7 +245,7 @@ jobs:
264
245
continue-on-error : true
265
246
266
247
phpunit-components :
267
- name : PHPUnit ${{ matrix.component }} (PHP ${{ matrix.php.version }} ${{ matrix.php.coverage && 'coverage' || '' }}${{ matrix.php.deprecations && 'no deprecations ' || '' }})
248
+ name : PHPUnit ${{ matrix.component }} (PHP ${{ matrix.php.version }} ${{ matrix.php.coverage && 'coverage' || '' }}${{ matrix.php.lowest && 'lowest ' || '' }})
268
249
runs-on : ubuntu-latest
269
250
timeout-minutes : 20
270
251
strategy :
@@ -275,7 +256,7 @@ jobs:
275
256
- version : ' 8.4'
276
257
coverage : true
277
258
- version : ' 8.4'
278
- deprecations : true
259
+ lowest : true
279
260
component :
280
261
- api-platform/doctrine-common
281
262
- api-platform/doctrine-orm
@@ -304,23 +285,24 @@ jobs:
304
285
tools : pecl, composer
305
286
extensions : intl, bcmath, curl, openssl, mbstring, pdo_sqlite, mongodb
306
287
ini-values : memory_limit=-1
307
- - name : Linking
288
+ - name : PMU
308
289
run : |
309
290
composer global require soyuka/pmu
310
291
composer global config allow-plugins.soyuka/pmu true --no-interaction
311
- composer global link . --permanent
312
- - name : Allow unstable project dependencies
313
- if : matrix.php.deprecations == true
292
+ - name : Linking
293
+ if : ${{ !matrix.php.lowest }}
314
294
run : |
315
- cd $( composer ${{matrix.component}} --cwd)
316
- composer config minimum-stability dev
295
+ composer global link . --permanent
296
+ composer ${{matrix.component}} update
317
297
- name : Run ${{ matrix.component }} install
298
+ if : ${{ matrix.php.lowest }}
318
299
run : |
319
- composer ${{matrix.component}} update
300
+ cd $(composer ${{matrix.component}} --cwd)
301
+ composer update${{ matrix.php.lowest && ' --prefer-lowest --prefer-source' || '' }}
320
302
- name : Run ${{ matrix.component }} tests
321
303
run : |
322
304
mkdir -p /tmp/build/logs/phpunit
323
- composer ${{matrix.component}} test --log-junit "/tmp/build/logs/phpunit/junit.xml" ${{ matrix.php.coverage && '--coverage-clover /tmp/build/logs/phpunit/clover.xml' || '' }} ${{ matrix.php.deprecations && '--fail-on-deprecation --display-deprecations ' || '' }}
305
+ composer ${{matrix.component}} test -- -- log-junit "/tmp/build/logs/phpunit/junit.xml" ${{ matrix.php.coverage && '--coverage-clover /tmp/build/logs/phpunit/clover.xml' || '' }}${{ matrix.php.lowest && ' --ignore-baseline ' || '' }}
324
306
- name : Upload test artifacts
325
307
if : always()
326
308
uses : actions/upload-artifact@v4
@@ -347,6 +329,56 @@ jobs:
347
329
php-coveralls --coverage_clover=/tmp/build/logs/phpunit/clover.xml
348
330
continue-on-error : true
349
331
332
+ phpunit-components-fail-deprecation :
333
+ name : PHPUnit no deprecations ${{ matrix.component }} (PHP ${{ matrix.php.version }}
334
+ runs-on : ubuntu-latest
335
+ timeout-minutes : 20
336
+ strategy :
337
+ matrix :
338
+ php :
339
+ - version : ' 8.4'
340
+ component :
341
+ - api-platform/doctrine-common
342
+ - api-platform/doctrine-orm
343
+ - api-platform/doctrine-odm
344
+ - api-platform/metadata
345
+ - api-platform/hydra
346
+ - api-platform/json-api
347
+ - api-platform/json-schema
348
+ - api-platform/elasticsearch
349
+ - api-platform/openapi
350
+ - api-platform/graphql
351
+ - api-platform/http-cache
352
+ - api-platform/ramsey-uuid
353
+ - api-platform/serializer
354
+ - api-platform/state
355
+ - api-platform/symfony
356
+ - api-platform/validator
357
+ fail-fast : false
358
+ steps :
359
+ - name : Checkout
360
+ uses : actions/checkout@v4
361
+ - name : Setup PHP
362
+ uses : shivammathur/setup-php@v2
363
+ with :
364
+ php-version : ${{ matrix.php.version }}
365
+ tools : pecl, composer
366
+ extensions : intl, bcmath, curl, openssl, mbstring, pdo_sqlite, mongodb
367
+ ini-values : memory_limit=-1
368
+ - name : Linking
369
+ run : |
370
+ composer global require soyuka/pmu
371
+ composer global config allow-plugins.soyuka/pmu true --no-interaction
372
+ composer global link . --permanent
373
+ - name : Run ${{ matrix.component }} install
374
+ run : |
375
+ composer ${{matrix.component}} update
376
+ - name : Run ${{ matrix.component }} tests
377
+ run : |
378
+ mkdir -p /tmp/build/logs/phpunit
379
+ cd $(composer ${{matrix.component}} --cwd)
380
+ ./vendor/bin/phpunit --fail-on-deprecation --display-deprecations --log-junit "/tmp/build/logs/phpunit/junit.xml"
381
+
350
382
behat :
351
383
name : Behat (PHP ${{ matrix.php }})
352
384
runs-on : ubuntu-latest
@@ -427,26 +459,6 @@ jobs:
427
459
export PATH="$PATH:$HOME/.composer/vendor/bin"
428
460
php-coveralls --coverage_clover=build/logs/behat/clover.xml
429
461
continue-on-error : true
430
- - name : Export OpenAPI documents
431
- run : |
432
- mkdir -p build/out/openapi
433
- tests/Fixtures/app/console api:openapi:export -o build/out/openapi/openapi_v3.json
434
- tests/Fixtures/app/console api:openapi:export --yaml -o build/out/openapi/openapi_v3.yaml
435
- - name : Setup node
436
- uses : actions/setup-node@v4
437
- with :
438
- node-version : ' 14'
439
- - name : Validate OpenAPI documents
440
- run : |
441
- npx swagger-cli validate build/out/openapi/openapi_v3.json
442
- npx swagger-cli validate build/out/openapi/openapi_v3.yaml
443
- - name : Upload OpenAPI artifacts
444
- if : always()
445
- uses : actions/upload-artifact@v4
446
- with :
447
- name : openapi-docs-php${{ matrix.php }}
448
- path : build/out/openapi
449
- continue-on-error : true
450
462
451
463
postgresql :
452
464
name : Behat (PHP ${{ matrix.php }}) (PostgreSQL)
@@ -726,8 +738,60 @@ jobs:
726
738
php-coveralls --coverage_clover=build/logs/behat/clover.xml
727
739
continue-on-error : true
728
740
729
- elasticsearch :
730
- name : Behat (PHP ${{ matrix.php }}) (Elasticsearch)
741
+ elasticsearch-v9 :
742
+ name : Behat (PHP ${{ matrix.php }}) (Elasticsearch v9)
743
+ runs-on : ubuntu-latest
744
+ timeout-minutes : 20
745
+ strategy :
746
+ matrix :
747
+ php :
748
+ - ' 8.4'
749
+ fail-fast : false
750
+ env :
751
+ APP_ENV : elasticsearch
752
+ steps :
753
+ - name : Checkout
754
+ uses : actions/checkout@v4
755
+ - name : Configure sysctl limits
756
+ run : |
757
+ sudo swapoff -a
758
+ sudo sysctl -w vm.swappiness=1
759
+ sudo sysctl -w fs.file-max=262144
760
+ sudo sysctl -w vm.max_map_count=262144
761
+ - name : Runs Elasticsearch
762
+ uses : elastic/elastic-github-actions/elasticsearch@master
763
+ with :
764
+ stack-version : ' 9.0.0'
765
+ security-enabled : false
766
+ - name : Setup PHP
767
+ uses : shivammathur/setup-php@v2
768
+ with :
769
+ php-version : ${{ matrix.php }}
770
+ tools : pecl, composer
771
+ extensions : intl, bcmath, curl, openssl, mbstring, mongodb
772
+ coverage : none
773
+ ini-values : memory_limit=-1
774
+ - name : Get composer cache directory
775
+ id : composercache
776
+ run : echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
777
+ - name : Cache dependencies
778
+ uses : actions/cache@v4
779
+ with :
780
+ path : ${{ steps.composercache.outputs.dir }}
781
+ key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
782
+ restore-keys : ${{ runner.os }}-composer-
783
+ - name : Update project dependencies
784
+ run : |
785
+ composer global require soyuka/pmu
786
+ composer global config allow-plugins.soyuka/pmu true --no-interaction
787
+ composer global link .
788
+ - name : Clear test app cache
789
+ run : tests/Fixtures/app/console cache:clear --ansi
790
+ - name : Run Behat tests
791
+ run : vendor/bin/behat --out=std --format=progress --profile=elasticsearch --no-interaction
792
+
793
+ elasticsearch-v8 :
794
+ name : Behat (PHP ${{ matrix.php }}) (Elasticsearch v8)
731
795
runs-on : ubuntu-latest
732
796
timeout-minutes : 20
733
797
strategy :
@@ -773,6 +837,7 @@ jobs:
773
837
composer global require soyuka/pmu
774
838
composer global config allow-plugins.soyuka/pmu true --no-interaction
775
839
composer global link .
840
+ composer require elasticsearch/elasticsearch "^8.4" -W
776
841
- name : Clear test app cache
777
842
run : tests/Fixtures/app/console cache:clear --ansi
778
843
- name : Run Behat tests
@@ -965,7 +1030,7 @@ jobs:
965
1030
strategy :
966
1031
matrix :
967
1032
php :
968
- - ' 8.3 '
1033
+ - ' 8.4 '
969
1034
fail-fast : false
970
1035
env :
971
1036
APP_ENV : sqlite
@@ -978,20 +1043,13 @@ jobs:
978
1043
with :
979
1044
php-version : ${{ matrix.php }}
980
1045
tools : pecl, composer
981
- extensions : intl, bcmath, curl, openssl, mbstring, pdo_sqlite, fileinfo
1046
+ extensions : intl, bcmath, curl, openssl, mbstring, pdo_sqlite, fileinfo, mongodb
982
1047
coverage : none
983
1048
ini-values : memory_limit=-1
984
- # Not in pecl
985
- - name : Setup mongodb
986
- run : |
987
- curl -sLO https://github.com/mongodb/mongo-php-driver/releases/download/1.17.2/php_mongodb-1.17.2-8.3-nts-x64.zip
988
- unzip -q php_mongodb-1.17.2-8.3-nts-x64.zip php_mongodb.dll
989
- mv php_mongodb.dll C:\tools\php\ext
990
- echo "extension=php_mongodb.dll" >> C:\tools\php\php.ini
991
1049
- name : Get composer cache directory
992
1050
id : composercache
993
- run : echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
994
1051
shell : bash
1052
+ run : echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
995
1053
- name : Cache dependencies
996
1054
uses : actions/cache@v4
997
1055
with :
@@ -1000,18 +1058,22 @@ jobs:
1000
1058
restore-keys : ${{ runner.os }}-composer-
1001
1059
- name : Keep windows path
1002
1060
id : get-cwd
1061
+ shell : bash
1003
1062
run : |
1004
1063
cwd=$(php -r 'echo(str_replace("\\", "\\\\", $_SERVER["argv"][1]));' '${{ github.workspace }}')
1005
1064
echo cwd=$cwd >> $GITHUB_OUTPUT
1006
- shell : bash
1007
1065
- name : Update project dependencies
1066
+ shell : bash
1008
1067
run : |
1068
+ php -m
1009
1069
composer global require soyuka/pmu
1010
1070
composer global config allow-plugins.soyuka/pmu true --no-interaction
1011
1071
composer global link . --working-directory='${{ steps.get-cwd.outputs.cwd }}'
1012
1072
- name : Clear test app cache
1073
+ shell : bash
1013
1074
run : tests/Fixtures/app/console cache:clear --ansi
1014
1075
- name : Run Behat tests
1076
+ shell : bash
1015
1077
run : vendor/bin/behat --out=std --format=progress --profile=default --no-interaction
1016
1078
1017
1079
phpunit-symfony-lowest :
@@ -1229,26 +1291,53 @@ jobs:
1229
1291
name : behat-logs-php${{ matrix.php }}
1230
1292
path : build/logs/behat
1231
1293
continue-on-error : true
1294
+
1295
+ openapi :
1296
+ name : OpenAPI
1297
+ runs-on : ubuntu-latest
1298
+ timeout-minutes : 20
1299
+ strategy :
1300
+ matrix :
1301
+ php :
1302
+ - ' 8.4'
1303
+ fail-fast : false
1304
+ steps :
1305
+ - name : Checkout
1306
+ uses : actions/checkout@v4
1307
+ - name : Setup PHP
1308
+ uses : shivammathur/setup-php@v2
1309
+ with :
1310
+ php-version : ${{ matrix.php }}
1311
+ tools : pecl, composer
1312
+ extensions : intl, bcmath, curl, openssl, mbstring, pdo_sqlite, mongodb
1313
+ ini-values : memory_limit=-1
1314
+ - name : Setup node
1315
+ uses : actions/setup-node@v4
1316
+ with :
1317
+ node-version : ' 22'
1318
+ - name : Get composer cache directory
1319
+ id : composercache
1320
+ run : echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
1321
+ - name : Cache dependencies
1322
+ uses : actions/cache@v4
1323
+ with :
1324
+ path : ${{ steps.composercache.outputs.dir }}
1325
+ key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
1326
+ restore-keys : ${{ runner.os }}-composer-
1327
+ - name : Update project dependencies
1328
+ run : |
1329
+ composer global require soyuka/pmu
1330
+ composer global config allow-plugins.soyuka/pmu true --no-interaction
1331
+ composer global link .
1332
+ - name : Clear test app cache
1333
+ run : tests/Fixtures/app/console cache:clear --ansi
1232
1334
- name : Export OpenAPI documents
1233
1335
run : |
1234
1336
mkdir -p build/out/openapi
1235
- tests/Fixtures/app/console api:openapi:export -o build/out/openapi/openapi_v3.json
1236
1337
tests/Fixtures/app/console api:openapi:export --yaml -o build/out/openapi/openapi_v3.yaml
1237
- - name : Setup node
1238
- uses : actions/setup-node@v4
1239
- with :
1240
- node-version : ' 14'
1241
1338
- name : Validate OpenAPI documents
1242
1339
run : |
1243
- npx swagger-cli validate build/out/openapi/openapi_v3.json
1244
- npx swagger-cli validate build/out/openapi/openapi_v3.yaml
1245
- - name : Upload OpenAPI artifacts
1246
- if : always()
1247
- uses : actions/upload-artifact@v4
1248
- with :
1249
- name : openapi-docs-php${{ matrix.php }}
1250
- path : build/out/openapi
1251
- continue-on-error : true
1340
+ npx @quobix/vacuum lint -r tests/Fixtures/app/ruleset.yaml build/out/openapi/openapi_v3.yaml -d --ignore-array-circle-ref --ignore-polymorph-circle-ref -b --no-clip
1252
1341
1253
1342
laravel :
1254
1343
name : Laravel (PHP ${{ matrix.php }})
0 commit comments