Skip to content

Commit 84d84d3

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into 4.8
2 parents f0648c6 + 8f87289 commit 84d84d3

149 files changed

Lines changed: 3892 additions & 711 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Composer update
2+
description: Restores the Composer download cache, runs `composer update` with retries and saves the cache for the resolved dependencies.
3+
4+
inputs:
5+
php-version:
6+
description: PHP version used as part of the cache key
7+
required: true
8+
options:
9+
description: Additional options appended to the `composer update` call
10+
required: false
11+
default: ''
12+
github-token:
13+
description: Token used to authenticate the downloads from GitHub
14+
required: false
15+
default: ${{ github.token }}
16+
17+
runs:
18+
using: composite
19+
steps:
20+
- name: Get composer cache directory
21+
id: composer-cache
22+
shell: bash
23+
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT"
24+
25+
- name: Restore composer cache
26+
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
27+
with:
28+
path: ${{ steps.composer-cache.outputs.COMPOSER_CACHE_FILES_DIR }}
29+
# Never matches an entry, so the restore always falls back to restore-keys.
30+
key: composer-php-${{ inputs.php-version }}-restore-${{ github.run_id }}-${{ github.run_attempt }}
31+
restore-keys: |
32+
composer-php-${{ inputs.php-version }}-
33+
composer-
34+
35+
- name: Install dependencies
36+
shell: bash
37+
env:
38+
GITHUB_TOKEN: ${{ inputs.github-token }}
39+
COMPOSER_OPTIONS: ${{ inputs.options }}
40+
run: |
41+
if [ -n "$GITHUB_TOKEN" ]; then
42+
composer config --global github-oauth.github.com "$GITHUB_TOKEN"
43+
fi
44+
45+
attempt=1
46+
until composer update --ansi --no-interaction $COMPOSER_OPTIONS; do
47+
if [ "$attempt" -ge 3 ]; then
48+
echo "::error::composer update failed after $attempt attempts."
49+
exit 1
50+
fi
51+
52+
delay=$((attempt * 30))
53+
echo "::warning::composer update failed on attempt $attempt. Retrying in ${delay}s."
54+
sleep "$delay"
55+
attempt=$((attempt + 1))
56+
done
57+
58+
- name: Save composer cache
59+
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
60+
with:
61+
path: ${{ steps.composer-cache.outputs.COMPOSER_CACHE_FILES_DIR }}
62+
key: composer-php-${{ inputs.php-version }}-${{ hashFiles('composer.lock') }}

‎.github/workflows/reusable-coveralls.yml‎

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,6 @@ jobs:
3737
run: ls -R
3838
working-directory: build/cov
3939

40-
- name: Get composer cache directory
41-
id: composer-cache
42-
run: |
43-
echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
44-
45-
- name: Cache dependencies
46-
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
47-
with:
48-
path: ${{ steps.composer-cache.outputs.COMPOSER_CACHE_FILES_DIR }}
49-
key: composer-php-${{ inputs.php-version }}-${{ hashFiles('**/composer.json') }}
50-
restore-keys: |
51-
composer-php-${{ inputs.php-version }}-
52-
composer-
53-
5440
- name: Cache PHPUnit's static analysis cache
5541
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
5642
with:
@@ -60,7 +46,9 @@ jobs:
6046
phpunit-code-coverage-
6147
6248
- name: Install dependencies
63-
run: composer update --ansi
49+
uses: ./.github/actions/composer-update
50+
with:
51+
php-version: ${{ inputs.php-version }}
6452

6553
- name: Merge coverage files
6654
run: |

‎.github/workflows/reusable-phpunit-test.yml‎

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -226,18 +226,8 @@ jobs:
226226
- name: Setup global environment variables
227227
id: setup-env
228228
run: |
229-
echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
230229
echo "ARTIFACT_NAME=${{ inputs.job-id || github.job }}-php-${{ inputs.php-version }}-db-${{ inputs.db-platform || 'none' }}${{ inputs.mysql-version || '' }}" >> $GITHUB_OUTPUT
231230
232-
- name: Cache dependencies
233-
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
234-
with:
235-
path: ${{ steps.setup-env.outputs.COMPOSER_CACHE_FILES_DIR }}
236-
key: composer-php-${{ inputs.php-version }}-${{ hashFiles('**/composer.json') }}
237-
restore-keys: |
238-
composer-php-${{ inputs.php-version }}-
239-
composer-
240-
241231
- name: Cache PHPUnit's static analysis cache
242232
if: ${{ inputs.enable-artifact-upload }}
243233
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
@@ -248,9 +238,10 @@ jobs:
248238
phpunit-code-coverage-
249239
250240
- name: Install dependencies
251-
run: |
252-
composer config --global github-oauth.github.com ${{ secrets.GITHUB_TOKEN }}
253-
composer update --ansi ${{ inputs.extra-composer-options }}
241+
uses: ./.github/actions/composer-update
242+
with:
243+
php-version: ${{ inputs.php-version }}
244+
options: ${{ inputs.extra-composer-options }}
254245

255246
- name: Compute additional PHPUnit options
256247
id: phpunit-options

‎.github/workflows/reusable-serviceless-phpunit-test.yml‎

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -85,18 +85,8 @@ jobs:
8585
- name: Setup global environment variables
8686
id: setup-env
8787
run: |
88-
echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
8988
echo "ARTIFACT_NAME=${{ inputs.job-id || github.job }}-php-${{ inputs.php-version }}" >> $GITHUB_OUTPUT
9089
91-
- name: Cache Composer dependencies
92-
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
93-
with:
94-
path: ${{ steps.setup-env.outputs.COMPOSER_CACHE_FILES_DIR }}
95-
key: composer-php-${{ inputs.php-version }}-${{ hashFiles('**/composer.json') }}
96-
restore-keys: |
97-
composer-php-${{ inputs.php-version }}-
98-
composer-
99-
10090
- name: Cache PHPUnit's static analysis cache
10191
if: ${{ inputs.enable-artifact-upload }}
10292
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
@@ -107,9 +97,10 @@ jobs:
10797
phpunit-code-coverage-
10898
10999
- name: Install dependencies
110-
run: |
111-
composer config --global github-oauth.github.com ${{ secrets.GITHUB_TOKEN }}
112-
composer update --ansi ${{ inputs.extra-composer-options }}
100+
uses: ./.github/actions/composer-update
101+
with:
102+
php-version: ${{ inputs.php-version }}
103+
options: ${{ inputs.extra-composer-options }}
113104

114105
- name: Compute additional PHPUnit options
115106
id: phpunit-options

‎.github/workflows/test-coding-standards.yml‎

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,11 @@ jobs:
4646
extensions: tokenizer
4747
coverage: none
4848

49-
- name: Get composer cache directory
50-
id: composer-cache
51-
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
52-
53-
- name: Cache dependencies
54-
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
55-
with:
56-
path: ${{ steps.composer-cache.outputs.COMPOSER_CACHE_FILES_DIR }}
57-
key: composer-php-${{ matrix.php-version }}-${{ hashFiles('**/composer.json') }}
58-
restore-keys: |
59-
composer-php-${{ matrix.php-version }}-
60-
composer-
61-
6249
- name: Install dependencies
63-
run: composer update --ansi --no-interaction ${{ matrix.composer-option }}
50+
uses: ./.github/actions/composer-update
51+
with:
52+
php-version: ${{ matrix.php-version }}
53+
options: ${{ matrix.composer-option }}
6454

6555
- name: Run lint
6656
run: composer cs

‎.github/workflows/test-phpstan.yml‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ on:
1515
- composer.json
1616
- phpstan.dist.neon
1717
- phpstan-baseline.php
18+
- 'docs/**'
19+
- 'admin/lint-docs-samples.php'
20+
- 'admin/docs-phpstan-baseline.php'
1821
- '.github/workflows/test-phpstan.yml'
1922

2023
push:
@@ -29,6 +32,9 @@ on:
2932
- composer.json
3033
- phpstan.dist.neon
3134
- phpstan-baseline.php
35+
- 'docs/**'
36+
- 'admin/lint-docs-samples.php'
37+
- 'admin/docs-phpstan-baseline.php'
3238
- '.github/workflows/test-phpstan.yml'
3339

3440
concurrency:
@@ -61,19 +67,6 @@ jobs:
6167
- name: Validate composer.json
6268
run: composer validate --strict
6369

64-
- name: Get composer cache directory
65-
id: composer-cache
66-
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
67-
68-
- name: Cache dependencies
69-
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
70-
with:
71-
path: ${{ steps.composer-cache.outputs.COMPOSER_CACHE_FILES_DIR }}
72-
key: composer-php-8.3-${{ hashFiles('**/composer.json') }}
73-
restore-keys: |
74-
composer-php-8.3-
75-
composer-
76-
7770
- name: Create PHPStan result cache directory
7871
run: mkdir -p build/phpstan
7972

@@ -85,7 +78,14 @@ jobs:
8578
restore-keys: phpstan-
8679

8780
- name: Install dependencies
88-
run: composer update --ansi --no-interaction
81+
uses: ./.github/actions/composer-update
82+
with:
83+
php-version: '8.3'
8984

9085
- name: Run static analysis
9186
run: composer phpstan:check
87+
88+
- name: Check that the baseline of the user guide samples is up to date
89+
run: |
90+
composer phpstan:docs-baseline
91+
git diff --exit-code admin/docs-phpstan-baseline.php

‎.github/workflows/test-psalm.yml‎

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -57,33 +57,27 @@ jobs:
5757
env:
5858
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5959

60-
- name: Get composer cache directory
61-
id: composer-cache
62-
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
63-
64-
- name: Cache composer dependencies
65-
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
66-
with:
67-
path: ${{ steps.composer-cache.outputs.COMPOSER_CACHE_FILES_DIR }}
68-
key: composer-php-${{ matrix.php-version }}-${{ hashFiles('**/composer.json') }}
69-
restore-keys: |
70-
composer-php-${{ matrix.php-version }}-
71-
composer-
72-
7360
- name: Create Psalm cache directory
7461
run: mkdir -p build/psalm
7562

76-
- name: Cache Psalm results
77-
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
63+
- name: Restore Psalm results
64+
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
7865
with:
7966
path: build/psalm
8067
key: psalm-${{ hashFiles('**/*.php', 'psalm*.xml', 'composer.json') }}
8168
restore-keys: psalm-
8269

8370
- name: Install dependencies
84-
run: |
85-
composer require sebastian/diff:^5.0 --ansi --working-dir utils
86-
composer update --ansi --no-interaction
71+
uses: ./.github/actions/composer-update
72+
with:
73+
php-version: ${{ matrix.php-version }}
8774

8875
- name: Run Psalm analysis
8976
run: utils/vendor/bin/psalm
77+
78+
- name: Save Psalm results
79+
if: ${{ github.event_name == 'push' }}
80+
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
81+
with:
82+
path: build/psalm
83+
key: psalm-${{ hashFiles('**/*.php', 'psalm*.xml', 'composer.json') }}

‎.github/workflows/test-random-execution.yml‎

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -181,23 +181,10 @@ jobs:
181181
ini-values: opcache.enable_cli=0
182182
coverage: none
183183

184-
- name: Get composer cache directory
185-
id: composer-cache
186-
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
187-
188-
- name: Cache composer dependencies
189-
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
190-
with:
191-
path: ${{ steps.composer-cache.outputs.COMPOSER_CACHE_FILES_DIR }}
192-
key: composer-php-${{ matrix.php-version }}-${{ hashFiles('**/composer.json') }}
193-
restore-keys: |
194-
composer-php-${{ matrix.php-version }}-
195-
composer-
196-
197184
- name: Install project dependencies
198-
run: |
199-
composer config --global github-oauth.github.com ${{ secrets.GITHUB_TOKEN }}
200-
composer update --ansi
185+
uses: ./.github/actions/composer-update
186+
with:
187+
php-version: ${{ matrix.php-version }}
201188

202189
- name: Run random test execution verification
203190
run: |

‎.github/workflows/test-rector.yml‎

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -67,19 +67,6 @@ jobs:
6767
- name: Validate composer.json
6868
run: composer validate --strict
6969

70-
- name: Get composer cache directory
71-
id: composer-cache
72-
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
73-
74-
- name: Cache dependencies
75-
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
76-
with:
77-
path: ${{ steps.composer-cache.outputs.COMPOSER_CACHE_FILES_DIR }}
78-
key: composer-php-${{ matrix.php-version }}-${{ hashFiles('**/composer.json') }}
79-
restore-keys: |
80-
composer-php-${{ matrix.php-version }}-
81-
composer-
82-
8370
- name: Rector Cache
8471
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
8572
with:
@@ -90,7 +77,10 @@ jobs:
9077
- run: mkdir -p /tmp/rector
9178

9279
- name: Install dependencies
93-
run: composer update --ansi --no-interaction ${{ matrix.composer-option }}
80+
uses: ./.github/actions/composer-update
81+
with:
82+
php-version: ${{ matrix.php-version }}
83+
options: ${{ matrix.composer-option }}
9484

9585
- name: Run static analysis
9686
run: vendor/bin/rector process --dry-run --no-progress-bar

‎.github/workflows/test-structarmed.yml‎

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -64,19 +64,6 @@ jobs:
6464
- name: Validate composer.json
6565
run: composer validate --strict
6666

67-
- name: Get composer cache directory
68-
id: composer-cache
69-
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
70-
71-
- name: Cache dependencies
72-
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
73-
with:
74-
path: ${{ steps.composer-cache.outputs.COMPOSER_CACHE_FILES_DIR }}
75-
key: composer-php-${{ matrix.php-version }}-${{ hashFiles('**/composer.json') }}
76-
restore-keys: |
77-
composer-php-${{ matrix.php-version }}-
78-
composer-
79-
8067
- name: Structarmed Cache
8168
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
8269
with:
@@ -87,7 +74,9 @@ jobs:
8774
- run: mkdir -p /tmp/structarmed
8875

8976
- name: Install dependencies
90-
run: composer update --ansi --no-interaction
77+
uses: ./.github/actions/composer-update
78+
with:
79+
php-version: ${{ matrix.php-version }}
9180

9281
- name: Run static analysis
9382
run: vendor/bin/structarmed analyze

0 commit comments

Comments
 (0)