Skip to content

Commit b577253

Browse files
authored
Merge branch '4.1' into fix-array-shape-param-parameters
2 parents e72ff4a + fe921cd commit b577253

File tree

262 files changed

+7894
-200757
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

262 files changed

+7894
-200757
lines changed

.commitlintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"elasticsearch",
1414
"mongodb",
1515
"jsonld",
16+
"httpcache",
1617
"hydra",
1718
"jsonapi",
1819
"graphql",

.github/workflows/api_platform.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 76 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,9 @@ concurrency:
1010

1111
env:
1212
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
13+
COMPOSER_ROOT_VERSION: "4.1.x-dev"
1314

1415
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-
3516
architecture:
3617
name: Check components interdependencies
3718
runs-on: ubuntu-latest
@@ -264,7 +245,7 @@ jobs:
264245
continue-on-error: true
265246

266247
phpunit-components:
267-
name: PHPUnit ${{ matrix.component }} (PHP ${{ matrix.php.version }} ${{ matrix.php.coverage && 'coverage' || '' }}
248+
name: PHPUnit ${{ matrix.component }} (PHP ${{ matrix.php.version }} ${{ matrix.php.coverage && 'coverage' || '' }}${{ matrix.php.lowest && 'lowest' || '' }})
268249
runs-on: ubuntu-latest
269250
timeout-minutes: 20
270251
strategy:
@@ -274,6 +255,8 @@ jobs:
274255
- version: '8.3'
275256
- version: '8.4'
276257
coverage: true
258+
- version: '8.4'
259+
lowest: true
277260
component:
278261
- api-platform/doctrine-common
279262
- api-platform/doctrine-orm
@@ -302,18 +285,24 @@ jobs:
302285
tools: pecl, composer
303286
extensions: intl, bcmath, curl, openssl, mbstring, pdo_sqlite, mongodb
304287
ini-values: memory_limit=-1
305-
- name: Linking
288+
- name: PMU
306289
run: |
307290
composer global require soyuka/pmu
308291
composer global config allow-plugins.soyuka/pmu true --no-interaction
292+
- name: Linking
293+
if: ${{ !matrix.php.lowest }}
294+
run: |
309295
composer global link . --permanent
296+
composer ${{matrix.component}} update
310297
- name: Run ${{ matrix.component }} install
298+
if: ${{ matrix.php.lowest }}
311299
run: |
312-
composer ${{matrix.component}} update
300+
cd $(composer ${{matrix.component}} --cwd)
301+
composer update${{ matrix.php.lowest && ' --prefer-lowest --prefer-source' || '' }}
313302
- name: Run ${{ matrix.component }} tests
314303
run: |
315304
mkdir -p /tmp/build/logs/phpunit
316-
composer ${{matrix.component}} test --log-junit "/tmp/build/logs/phpunit/junit.xml" ${{ matrix.php.coverage && '--coverage-clover /tmp/build/logs/phpunit/clover.xml' || '' }}
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' || '' }}
317306
- name: Upload test artifacts
318307
if: always()
319308
uses: actions/upload-artifact@v4
@@ -769,8 +758,60 @@ jobs:
769758
php-coveralls --coverage_clover=build/logs/behat/clover.xml
770759
continue-on-error: true
771760

772-
elasticsearch:
773-
name: Behat (PHP ${{ matrix.php }}) (Elasticsearch)
761+
elasticsearch-v9:
762+
name: Behat (PHP ${{ matrix.php }}) (Elasticsearch v9)
763+
runs-on: ubuntu-latest
764+
timeout-minutes: 20
765+
strategy:
766+
matrix:
767+
php:
768+
- '8.4'
769+
fail-fast: false
770+
env:
771+
APP_ENV: elasticsearch
772+
steps:
773+
- name: Checkout
774+
uses: actions/checkout@v4
775+
- name: Configure sysctl limits
776+
run: |
777+
sudo swapoff -a
778+
sudo sysctl -w vm.swappiness=1
779+
sudo sysctl -w fs.file-max=262144
780+
sudo sysctl -w vm.max_map_count=262144
781+
- name: Runs Elasticsearch
782+
uses: elastic/elastic-github-actions/elasticsearch@master
783+
with:
784+
stack-version: '9.0.0'
785+
security-enabled: false
786+
- name: Setup PHP
787+
uses: shivammathur/setup-php@v2
788+
with:
789+
php-version: ${{ matrix.php }}
790+
tools: pecl, composer
791+
extensions: intl, bcmath, curl, openssl, mbstring, mongodb
792+
coverage: none
793+
ini-values: memory_limit=-1
794+
- name: Get composer cache directory
795+
id: composercache
796+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
797+
- name: Cache dependencies
798+
uses: actions/cache@v4
799+
with:
800+
path: ${{ steps.composercache.outputs.dir }}
801+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
802+
restore-keys: ${{ runner.os }}-composer-
803+
- name: Update project dependencies
804+
run: |
805+
composer global require soyuka/pmu
806+
composer global config allow-plugins.soyuka/pmu true --no-interaction
807+
composer global link .
808+
- name: Clear test app cache
809+
run: tests/Fixtures/app/console cache:clear --ansi
810+
- name: Run Behat tests
811+
run: vendor/bin/behat --out=std --format=progress --profile=elasticsearch --no-interaction
812+
813+
elasticsearch-v8:
814+
name: Behat (PHP ${{ matrix.php }}) (Elasticsearch v8)
774815
runs-on: ubuntu-latest
775816
timeout-minutes: 20
776817
strategy:
@@ -816,6 +857,7 @@ jobs:
816857
composer global require soyuka/pmu
817858
composer global config allow-plugins.soyuka/pmu true --no-interaction
818859
composer global link .
860+
composer require elasticsearch/elasticsearch "^8.4" -W
819861
- name: Clear test app cache
820862
run: tests/Fixtures/app/console cache:clear --ansi
821863
- name: Run Behat tests
@@ -1026,15 +1068,16 @@ jobs:
10261068
ini-values: memory_limit=-1
10271069
# Not in pecl
10281070
- name: Setup mongodb
1071+
shell: bash
10291072
run: |
10301073
curl -sLO https://github.com/mongodb/mongo-php-driver/releases/download/1.17.2/php_mongodb-1.17.2-8.3-nts-x64.zip
10311074
unzip -q php_mongodb-1.17.2-8.3-nts-x64.zip php_mongodb.dll
1032-
mv php_mongodb.dll C:\tools\php\ext
1033-
echo "extension=php_mongodb.dll" >> C:\tools\php\php.ini
1075+
mv php_mongodb.dll C:/tools/php/ext
1076+
echo "extension=php_mongodb.dll" >> C:/tools/php/php.ini
10341077
- name: Get composer cache directory
10351078
id: composercache
1036-
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
10371079
shell: bash
1080+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
10381081
- name: Cache dependencies
10391082
uses: actions/cache@v4
10401083
with:
@@ -1043,18 +1086,21 @@ jobs:
10431086
restore-keys: ${{ runner.os }}-composer-
10441087
- name: Keep windows path
10451088
id: get-cwd
1089+
shell: bash
10461090
run: |
10471091
cwd=$(php -r 'echo(str_replace("\\", "\\\\", $_SERVER["argv"][1]));' '${{ github.workspace }}')
10481092
echo cwd=$cwd >> $GITHUB_OUTPUT
1049-
shell: bash
10501093
- name: Update project dependencies
1094+
shell: bash
10511095
run: |
10521096
composer global require soyuka/pmu
10531097
composer global config allow-plugins.soyuka/pmu true --no-interaction
10541098
composer global link . --working-directory='${{ steps.get-cwd.outputs.cwd }}'
10551099
- name: Clear test app cache
1100+
shell: bash
10561101
run: tests/Fixtures/app/console cache:clear --ansi
10571102
- name: Run Behat tests
1103+
shell: bash
10581104
run: vendor/bin/behat --out=std --format=progress --profile=default --no-interaction
10591105

10601106
phpunit-symfony-lowest:

.github/workflows/commitlint.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Commit Lint
2+
3+
on:
4+
pull_request_target:
5+
types: [opened, reopened, synchronize]
6+
7+
jobs:
8+
commitlint:
9+
if: github.event_name == 'pull_request_target'
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
with:
14+
fetch-depth: 0
15+
- name: Fetch PR head
16+
run: git fetch origin pull/${{ github.event.pull_request.number }}/head:pr_head
17+
- name: Run commitlint
18+
run: |
19+
merge_base_sha=$(git merge-base HEAD pr_head)
20+
first_commit_sha=$(git rev-list --no-merges --reverse $merge_base_sha..pr_head | head -n 1)
21+
22+
if [ -z "$first_commit_sha" ]; then
23+
echo "Could not determine the first commit of the PR. Skipping."
24+
exit 0
25+
fi
26+
27+
commit_message=$(git log -1 --pretty=%B $first_commit_sha)
28+
# we can't use npx see https://github.com/conventional-changelog/commitlint/issues/613
29+
echo '{}' > package.json
30+
npm install --no-fund --no-audit @commitlint/config-conventional @commitlint/cli
31+
echo "$commit_message" | ./node_modules/.bin/commitlint -g .commitlintrc
32+

.github/workflows/release.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Release Pipeline
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
branches:
8+
- main
9+
- '[0-9].*'
10+
- '[0-9][0-9].*'
11+
workflow_dispatch:
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
split:
19+
name: Subtree Split
20+
runs-on: ubuntu-latest
21+
permissions:
22+
contents: write
23+
steps:
24+
- name: Generate App Token
25+
id: generate_token
26+
uses: tibdex/github-app-token@v2
27+
with:
28+
app_id: ${{ secrets.API_PLATFORM_APP_ID }}
29+
private_key: ${{ secrets.API_PLATFORM_APP_PRIVATE_KEY }}
30+
31+
- name: Checkout repository
32+
uses: actions/checkout@v4
33+
with:
34+
token: ${{ steps.generate_token.outputs.token }}
35+
fetch-depth: 0
36+
37+
- name: Install splitsh
38+
run: |
39+
curl -L https://github.com/splitsh/lite/releases/download/v1.0.1/lite_linux_amd64.tar.gz > lite_linux_amd64.tar.gz
40+
tar -zxpf lite_linux_amd64.tar.gz
41+
chmod +x splitsh-lite
42+
echo "$(pwd)" >> $GITHUB_PATH
43+
44+
- name: Split to manyrepo
45+
run: find src -maxdepth 3 -name composer.json -print0 | xargs -I '{}' -n 1 -0 bash subtree.sh {} ${{ github.ref }}
46+
47+
dispatch-distribution-update:
48+
name: Dispatch Distribution Update
49+
runs-on: ubuntu-latest
50+
needs: split
51+
if: startsWith(github.ref, 'refs/tags/')
52+
steps:
53+
- name: Generate App Token
54+
id: generate_token
55+
uses: tibdex/github-app-token@v2
56+
with:
57+
app_id: ${{ secrets.API_PLATFORM_APP_ID }}
58+
private_key: ${{ secrets.API_PLATFORM_APP_PRIVATE_KEY }}
59+
60+
- name: Update distribution
61+
env:
62+
GH_TOKEN: ${{ steps.generate_token.outputs.token }}
63+
run: gh workflow run -R api-platform/api-platform release.yml -f tag=${{ github.ref_name }}

.github/workflows/subtree.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)