Skip to content

Commit 7686376

Browse files
authored
Merge branch 'WordPress:trunk' into trunk
2 parents 2640434 + cfd09a4 commit 7686376

File tree

280 files changed

+5104
-4491
lines changed

Some content is hidden

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

280 files changed

+5104
-4491
lines changed

.github/workflows/coding-standards.yml

Lines changed: 22 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ on:
2121
# Any change to a PHP or JavaScript file should run checks.
2222
- '**.js'
2323
- '**.php'
24-
# These files configure NPM. Changes could affect the outcome.
24+
# These files configure npm. Changes could affect the outcome.
2525
- 'package*.json'
2626
# These files configure Composer. Changes could affect the outcome.
2727
- 'composer.*'
@@ -48,13 +48,13 @@ jobs:
4848
# Performs the following steps:
4949
# - Checks out the repository.
5050
# - Sets up PHP.
51-
# - Logs debug information.
5251
# - Configures caching for PHPCS scans.
53-
# - Installs Composer dependencies (use cache if possible).
52+
# - Installs Composer dependencies.
5453
# - Make Composer packages available globally.
55-
# - Logs PHP_CodeSniffer debug information.
5654
# - Runs PHPCS on the full codebase with warnings suppressed.
55+
# - Generate a report for displaying issues as pull request annotations.
5756
# - Runs PHPCS on the `tests` directory without warnings suppressed.
57+
# - Generate a report for displaying `test` directory issues as pull request annotations.
5858
# - Ensures version-controlled files are not modified or deleted.
5959
phpcs:
6060
name: PHP coding standards
@@ -67,52 +67,48 @@ jobs:
6767
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
6868

6969
- name: Set up PHP
70-
uses: shivammathur/setup-php@e04e1d97f0c0481c6e1ba40f8a538454fe5d7709 # v2.21.2
70+
uses: shivammathur/setup-php@1a18b2267f80291a81ca1d33e7c851fe09e7dfc4 # v2.22.0
7171
with:
7272
php-version: '7.4'
7373
coverage: none
74-
tools: composer, cs2pr
75-
76-
- name: Log debug information
77-
run: |
78-
php --version
79-
composer --version
74+
tools: cs2pr
8075

8176
# This date is used to ensure that the PHPCS cache is cleared at least once every week.
8277
# http://man7.org/linux/man-pages/man1/date.1.html
8378
- name: "Get last Monday's date"
8479
id: get-date
85-
run: echo "::set-output name=date::$(/bin/date -u --date='last Mon' "+%F")"
80+
run: echo "date=$(/bin/date -u --date='last Mon' "+%F")" >> $GITHUB_OUTPUT
8681

8782
- name: Cache PHPCS scan cache
8883
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 # v3.0.11
8984
with:
9085
path: .cache/phpcs.json
9186
key: ${{ runner.os }}-date-${{ steps.get-date.outputs.date }}-phpcs-cache-${{ hashFiles('**/composer.json', 'phpcs.xml.dist') }}
9287

88+
# Since Composer dependencies are installed using `composer update` and no lock file is in version control,
89+
# passing a custom cache suffix ensures that the cache is flushed at least once per week.
9390
- name: Install Composer dependencies
94-
uses: ramsey/composer-install@f680dac46551dffb2234a240d65ae806c2999dd6 # v2.1.0
91+
uses: ramsey/composer-install@83af392bf5f031813d25e6fe4cd626cdba9a2df6 # v2.2.0
9592
with:
96-
composer-options: "--no-progress --no-ansi"
93+
custom-cache-suffix: ${{ steps.get-date.outputs.date }}
9794

9895
- name: Make Composer packages available globally
9996
run: echo "${PWD}/vendor/bin" >> $GITHUB_PATH
10097

101-
- name: Log PHPCS debug information
102-
run: phpcs -i
103-
10498
- name: Run PHPCS on all Core files
105-
continue-on-error: true
99+
id: phpcs-core
106100
run: phpcs -n --report-full --report-checkstyle=./.cache/phpcs-report.xml
107101

108102
- name: Show PHPCS results in PR
103+
if: ${{ always() && steps.phpcs-core.outcome == 'failure' }}
109104
run: cs2pr ./.cache/phpcs-report.xml
110105

111106
- name: Check test suite files for warnings
112-
continue-on-error: true
107+
id: phpcs-tests
113108
run: phpcs tests --report-full --report-checkstyle=./.cache/phpcs-tests-report.xml
114109

115110
- name: Show test suite scan results in PR
111+
if: ${{ always() && steps.phpcs-tests.outcome == 'failure' }}
116112
run: cs2pr ./.cache/phpcs-tests-report.xml
117113

118114
- name: Ensure version-controlled files are not modified during the tests
@@ -124,10 +120,9 @@ jobs:
124120
#
125121
# Performs the following steps:
126122
# - Checks out the repository.
123+
# - Sets up Node.js.
127124
# - Logs debug information about the GitHub Action runner.
128-
# - Installs NodeJS.
129-
# - Logs updated debug information.
130-
# _ Installs NPM dependencies.
125+
# - Installs npm dependencies.
131126
# - Run the WordPress JSHint checks.
132127
# - Ensures version-controlled files are not modified or deleted.
133128
jshint:
@@ -142,14 +137,7 @@ jobs:
142137
- name: Checkout repository
143138
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
144139

145-
- name: Log debug information
146-
run: |
147-
npm --version
148-
node --version
149-
git --version
150-
svn --version
151-
152-
- name: Install NodeJS
140+
- name: Set up Node.js
153141
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1
154142
with:
155143
node-version-file: '.nvmrc'
@@ -159,8 +147,10 @@ jobs:
159147
run: |
160148
npm --version
161149
node --version
150+
git --version
151+
svn --version
162152
163-
- name: Install Dependencies
153+
- name: Install npm Dependencies
164154
run: npm ci
165155

166156
- name: Run JSHint
@@ -207,7 +197,7 @@ jobs:
207197
owner: context.repo.owner,
208198
repo: context.repo.repo,
209199
workflow_id: 'failed-workflow.yml',
210-
ref: '${{ github.ref_name }}',
200+
ref: 'trunk',
211201
inputs: {
212202
run_id: '${{ github.run_id }}'
213203
}

.github/workflows/end-to-end-tests.yml

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,11 @@ jobs:
3535
# Performs the following steps:
3636
# - Sets environment variables.
3737
# - Checks out the repository.
38+
# - Sets up Node.js.
3839
# - Logs debug information about the GitHub Action runner.
39-
# - Installs NodeJS.
40-
# _ Installs NPM dependencies.
40+
# - Installs npm dependencies.
4141
# - Builds WordPress to run from the `build` directory.
4242
# - Starts the WordPress Docker container.
43-
# - Logs general debug information.
4443
# - Logs the running Docker containers.
4544
# - Logs Docker debug information (about both the Docker installation within the runner and the WordPress container).
4645
# - Install WordPress within the Docker container.
@@ -61,24 +60,22 @@ jobs:
6160
- name: Checkout repository
6261
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
6362

63+
- name: Set up Node.js
64+
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1
65+
with:
66+
node-version-file: '.nvmrc'
67+
cache: npm
68+
6469
- name: Log debug information
6570
run: |
6671
npm --version
6772
node --version
6873
curl --version
6974
git --version
7075
svn --version
71-
php --version
72-
php -i
7376
locale -a
7477
75-
- name: Install NodeJS
76-
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1
77-
with:
78-
node-version-file: '.nvmrc'
79-
cache: npm
80-
81-
- name: Install Dependencies
78+
- name: Install npm Dependencies
8279
run: npm ci
8380

8481
- name: Build WordPress
@@ -88,14 +85,6 @@ jobs:
8885
run: |
8986
npm run env:start
9087
91-
- name: General debug information
92-
run: |
93-
npm --version
94-
node --version
95-
curl --version
96-
git --version
97-
svn --version
98-
9988
- name: Log running Docker containers
10089
run: docker ps -a
10190

@@ -155,7 +144,7 @@ jobs:
155144
owner: context.repo.owner,
156145
repo: context.repo.repo,
157146
workflow_id: 'failed-workflow.yml',
158-
ref: '${{ github.ref_name }}',
147+
ref: 'trunk',
159148
inputs: {
160149
run_id: '${{ github.run_id }}'
161150
}

.github/workflows/javascript-tests.yml

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ on:
1919
paths:
2020
# Any change to a JavaScript file should run tests.
2121
- '**.js'
22-
# These files configure NPM. Changes could affect the outcome.
22+
# These files configure npm. Changes could affect the outcome.
2323
- 'package*.json'
2424
# This file configures ESLint. Changes could affect the outcome.
2525
- '.eslintignore'
@@ -43,10 +43,9 @@ jobs:
4343
#
4444
# Performs the following steps:
4545
# - Checks out the repository.
46+
# - Sets up Node.js.
4647
# - Logs debug information about the GitHub Action runner.
47-
# - Installs NodeJS.
48-
# - Logs updated debug information.
49-
# _ Installs NPM dependencies.
48+
# - Installs npm dependencies.
5049
# - Run the WordPress QUnit tests.
5150
# - Ensures version-controlled files are not modified or deleted.
5251
test-js:
@@ -59,14 +58,7 @@ jobs:
5958
- name: Checkout repository
6059
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
6160

62-
- name: Log debug information
63-
run: |
64-
npm --version
65-
node --version
66-
git --version
67-
svn --version
68-
69-
- name: Install NodeJS
61+
- name: Set up Node.js
7062
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1
7163
with:
7264
node-version-file: '.nvmrc'
@@ -76,8 +68,10 @@ jobs:
7668
run: |
7769
npm --version
7870
node --version
71+
git --version
72+
svn --version
7973
80-
- name: Install Dependencies
74+
- name: Install npm Dependencies
8175
run: npm ci
8276

8377
- name: Run QUnit tests
@@ -123,7 +117,7 @@ jobs:
123117
owner: context.repo.owner,
124118
repo: context.repo.repo,
125119
workflow_id: 'failed-workflow.yml',
126-
ref: '${{ github.ref_name }}',
120+
ref: 'trunk',
127121
inputs: {
128122
run_id: '${{ github.run_id }}'
129123
}

.github/workflows/php-compatibility.yml

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ jobs:
4646
# - Sets up PHP.
4747
# - Logs debug information.
4848
# - Configures caching for PHP compatibility scans.
49-
# - Installs Composer dependencies (use cache if possible).
49+
# - Installs Composer dependencies.
5050
# - Make Composer packages available globally.
51-
# - Logs PHP_CodeSniffer debug information.
5251
# - Runs the PHP compatibility tests.
52+
# - Generate a report for displaying issues as pull request annotations.
5353
# - Ensures version-controlled files are not modified or deleted.
5454
php-compatibility:
5555
name: Check PHP compatibility
@@ -62,45 +62,44 @@ jobs:
6262
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
6363

6464
- name: Set up PHP
65-
uses: shivammathur/setup-php@e04e1d97f0c0481c6e1ba40f8a538454fe5d7709 # v2.21.2
65+
uses: shivammathur/setup-php@1a18b2267f80291a81ca1d33e7c851fe09e7dfc4 # v2.22.0
6666
with:
6767
php-version: '7.4'
6868
coverage: none
69-
tools: composer, cs2pr
69+
tools: cs2pr
7070

7171
- name: Log debug information
7272
run: |
73-
php --version
7473
composer --version
7574
7675
# This date is used to ensure that the PHP compatibility cache is cleared at least once every week.
7776
# http://man7.org/linux/man-pages/man1/date.1.html
7877
- name: "Get last Monday's date"
7978
id: get-date
80-
run: echo "::set-output name=date::$(/bin/date -u --date='last Mon' "+%F")"
79+
run: echo "date=$(/bin/date -u --date='last Mon' "+%F")" >> $GITHUB_OUTPUT
8180

8281
- name: Cache PHP compatibility scan cache
8382
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 # v3.0.11
8483
with:
8584
path: .cache/phpcompat.json
8685
key: ${{ runner.os }}-date-${{ steps.get-date.outputs.date }}-phpcompat-cache-${{ hashFiles('**/composer.json', 'phpcompat.xml.dist') }}
8786

87+
# Since Composer dependencies are installed using `composer update` and no lock file is in version control,
88+
# passing a custom cache suffix ensures that the cache is flushed at least once per week.
8889
- name: Install Composer dependencies
89-
uses: ramsey/composer-install@f680dac46551dffb2234a240d65ae806c2999dd6 # v2.1.0
90+
uses: ramsey/composer-install@83af392bf5f031813d25e6fe4cd626cdba9a2df6 # v2.2.0
9091
with:
91-
composer-options: "--no-progress --no-ansi"
92+
custom-cache-suffix: ${{ steps.get-date.outputs.date }}
9293

9394
- name: Make Composer packages available globally
9495
run: echo "${PWD}/vendor/bin" >> $GITHUB_PATH
9596

96-
- name: Log PHPCS debug information
97-
run: phpcs -i
98-
9997
- name: Run PHP compatibility tests
100-
continue-on-error: true
98+
id: phpcs
10199
run: phpcs --standard=phpcompat.xml.dist --report-full --report-checkstyle=./.cache/phpcs-compat-report.xml
102100

103101
- name: Show PHPCompatibility results in PR
102+
if: ${{ always() && steps.phpcs.outcome == 'failure' }}
104103
run: cs2pr ./.cache/phpcs-compat-report.xml
105104

106105
- name: Ensure version-controlled files are not modified or deleted
@@ -143,7 +142,7 @@ jobs:
143142
owner: context.repo.owner,
144143
repo: context.repo.repo,
145144
workflow_id: 'failed-workflow.yml',
146-
ref: '${{ github.ref_name }}',
145+
ref: 'trunk',
147146
inputs: {
148147
run_id: '${{ github.run_id }}'
149148
}

0 commit comments

Comments
 (0)