Skip to content

Commit f41f660

Browse files
authored
Merge branch 'WordPress:trunk' into trunk
2 parents e746449 + 54c4de1 commit f41f660

208 files changed

Lines changed: 6806 additions & 1714 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.

.github/workflows/coding-standards.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ jobs:
143143
timeout-minutes: 20
144144
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
145145
env:
146-
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: ${{ true }}
146+
PUPPETEER_SKIP_DOWNLOAD: ${{ true }}
147147

148148
steps:
149149
- name: Checkout repository
@@ -182,7 +182,7 @@ jobs:
182182
needs: [ phpcs, jshint ]
183183
if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
184184
with:
185-
calling_status: ${{ needs.phpcs.result == 'success' && needs.jshint.result == 'success' && 'success' || ( needs.phpcs.result == 'cancelled' || needs.jshint.result == 'cancelled' ) && 'cancelled' || 'failure' }}
185+
calling_status: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }}
186186
secrets:
187187
SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }}
188188
SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }}
@@ -201,8 +201,8 @@ jobs:
201201
github.event_name != 'pull_request' &&
202202
github.run_attempt < 2 &&
203203
(
204-
needs.phpcs.result == 'cancelled' || needs.phpcs.result == 'failure' ||
205-
needs.jshint.result == 'cancelled' || needs.jshint.result == 'failure'
204+
contains( needs.*.result, 'cancelled' ) ||
205+
contains( needs.*.result, 'failure' )
206206
)
207207
208208
steps:
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
name: Installation Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- trunk
7+
# Always test the workflow after it's updated.
8+
paths:
9+
- '.github/workflows/install-testing.yml'
10+
pull_request:
11+
# Always test the workflow when changes are suggested.
12+
paths:
13+
- '.github/workflows/install-testing.yml'
14+
workflow_dispatch:
15+
inputs:
16+
wp-version:
17+
description: 'The version to test installing. Accepts major and minor versions, "latest", or "nightly". Major releases must not end with ".0".'
18+
type: string
19+
default: 'latest'
20+
21+
# Cancels all previous workflow runs for pull requests that have not completed.
22+
concurrency:
23+
# The concurrency group contains the workflow name and the branch name for pull requests
24+
# or the commit hash for any other events.
25+
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
26+
cancel-in-progress: true
27+
28+
# Disable permissions for all available scopes by default.
29+
# Any needed permissions should be configured at the job level.
30+
permissions: {}
31+
32+
jobs:
33+
# Test the WordPress installation process through WP-CLI.
34+
#
35+
# Performs the following steps:
36+
# - Sets up PHP.
37+
# - Starts the database server.
38+
# - Downloads the specified version of WordPress.
39+
# - Creates a `wp-config.php` file.
40+
# - Installs WordPress.
41+
install-tests-mysql:
42+
name: WP ${{ inputs.new-version || 'latest' }} / PHP ${{ matrix.php }} / ${{ 'mariadb' == matrix.db-type && 'MariaDB' || 'MySQL' }} ${{ matrix.db-version }}${{ matrix.multisite && ' multisite' || '' }}
43+
permissions:
44+
contents: read
45+
runs-on: ubuntu-latest
46+
timeout-minutes: 10
47+
strategy:
48+
fail-fast: false
49+
matrix:
50+
os: [ ubuntu-latest ]
51+
php: [ '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3' ]
52+
db-type: [ 'mysql' ]
53+
db-version: [ '5.7', '8.0' ]
54+
multisite: [ false, true ]
55+
56+
services:
57+
database:
58+
image: ${{ matrix.db-type }}:${{ matrix.db-version }}
59+
ports:
60+
- 3306
61+
options: --health-cmd="mysqladmin ping" --health-interval=30s --health-timeout=10s --health-retries=5 -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=test_db --entrypoint sh ${{ matrix.db-type }}:${{ matrix.db-version }} -c "exec docker-entrypoint.sh mysqld --default-authentication-plugin=mysql_native_password"
62+
63+
steps:
64+
- name: Set up PHP ${{ matrix.php }}
65+
uses: shivammathur/setup-php@7fdd3ece872ec7ec4c098ae5ab7637d5e0a96067 # v2.26.0
66+
with:
67+
php-version: '${{ matrix.php }}'
68+
coverage: none
69+
tools: wp-cli
70+
71+
- name: Start the database server
72+
run: |
73+
sudo systemctl start ${{ matrix.db-type }}
74+
75+
- name: Download WordPress
76+
run: wp core download ${{ inputs.wp-version && 'latest' != inputs.wp-version && format( '--version={0}', inputs.wp-version ) || '' }}
77+
78+
- name: Create wp-config.php file
79+
run: wp config create --dbname=test_db --dbuser=root --dbpass=root --dbhost=127.0.0.1:${{ job.services.database.ports['3306'] }}
80+
81+
- name: Install WordPress
82+
run: wp core ${{ matrix.multisite && 'multisite-' || '' }}install --url=http://localhost/ --title="Upgrade Test" --admin_user=admin --admin_password=password --admin_email=me@example.org --skip-email
83+
84+
slack-notifications:
85+
name: Slack Notifications
86+
uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk
87+
permissions:
88+
actions: read
89+
contents: read
90+
needs: [ install-tests-mysql ]
91+
if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
92+
with:
93+
calling_status: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }}
94+
secrets:
95+
SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }}
96+
SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }}
97+
SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }}
98+
SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }}
99+
100+
failed-workflow:
101+
name: Failed workflow tasks
102+
runs-on: ubuntu-latest
103+
permissions:
104+
actions: write
105+
needs: [ slack-notifications ]
106+
if: |
107+
always() &&
108+
github.repository == 'WordPress/wordpress-develop' &&
109+
github.event_name != 'pull_request' &&
110+
github.run_attempt < 2 &&
111+
(
112+
contains( needs.*.result, 'cancelled' ) ||
113+
contains( needs.*.result, 'failure' )
114+
)
115+
116+
steps:
117+
- name: Dispatch workflow run
118+
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
119+
with:
120+
retries: 2
121+
retry-exempt-status-codes: 418
122+
script: |
123+
github.rest.actions.createWorkflowDispatch({
124+
owner: context.repo.owner,
125+
repo: context.repo.repo,
126+
workflow_id: 'failed-workflow.yml',
127+
ref: 'trunk',
128+
inputs: {
129+
run_id: '${{ github.run_id }}'
130+
}
131+
});

.github/workflows/javascript-tests.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ jobs:
9797
needs: [ test-js ]
9898
if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
9999
with:
100-
calling_status: ${{ needs.test-js.result == 'success' && 'success' || needs.test-js.result == 'cancelled' && 'cancelled' || 'failure' }}
100+
calling_status: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }}
101101
secrets:
102102
SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }}
103103
SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }}
@@ -116,7 +116,8 @@ jobs:
116116
github.event_name != 'pull_request' &&
117117
github.run_attempt < 2 &&
118118
(
119-
needs.test-js.result == 'cancelled' || needs.test-js.result == 'failure'
119+
contains( needs.*.result, 'cancelled' ) ||
120+
contains( needs.*.result, 'failure' )
120121
)
121122
122123
steps:

.github/workflows/performance.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ jobs:
251251
needs: [ performance ]
252252
if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
253253
with:
254-
calling_status: ${{ needs.performance.result == 'success' && 'success' || needs.performance.result == 'cancelled' && 'cancelled' || 'failure' }}
254+
calling_status: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }}
255255
secrets:
256256
SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }}
257257
SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }}
@@ -270,7 +270,8 @@ jobs:
270270
github.event_name != 'pull_request' &&
271271
github.run_attempt < 2 &&
272272
(
273-
needs.performance.result == 'cancelled' || needs.performance.result == 'failure'
273+
contains( needs.*.result, 'cancelled' ) ||
274+
contains( needs.*.result, 'failure' )
274275
)
275276
276277
steps:

.github/workflows/php-compatibility.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ jobs:
122122
needs: [ php-compatibility ]
123123
if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
124124
with:
125-
calling_status: ${{ needs.php-compatibility.result == 'success' && 'success' || needs.php-compatibility.result == 'cancelled' && 'cancelled' || 'failure' }}
125+
calling_status: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }}
126126
secrets:
127127
SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }}
128128
SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }}
@@ -141,7 +141,8 @@ jobs:
141141
github.event_name != 'pull_request' &&
142142
github.run_attempt < 2 &&
143143
(
144-
needs.php-compatibility.result == 'cancelled' || needs.php-compatibility.result == 'failure'
144+
contains( needs.*.result, 'cancelled' ) ||
145+
contains( needs.*.result, 'failure' )
145146
)
146147
147148
steps:

.github/workflows/phpunit-tests-run.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ env:
5151
LOCAL_DB_VERSION: ${{ inputs.db-version }}
5252
LOCAL_PHP_MEMCACHED: ${{ inputs.memcached }}
5353
PHPUNIT_CONFIG: ${{ inputs.phpunit-config }}
54-
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: ${{ true }}
54+
PUPPETEER_SKIP_DOWNLOAD: ${{ true }}
5555

5656
jobs:
5757
# Runs the PHPUnit tests for WordPress.

.github/workflows/phpunit-tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ jobs:
136136
needs: [ test-with-mysql, test-with-mariadb ]
137137
if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
138138
with:
139-
calling_status: ${{ needs.test-with-mysql.result == 'success' && needs.test-with-mariadb.result == 'success' && 'success' || ( needs.test-with-mysql.result == 'cancelled' || needs.test-with-mariadb.result == 'cancelled' ) && 'cancelled' || 'failure' }}
139+
calling_status: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }}
140140
secrets:
141141
SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }}
142142
SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }}
@@ -155,8 +155,8 @@ jobs:
155155
github.event_name != 'pull_request' &&
156156
github.run_attempt < 2 &&
157157
(
158-
needs.test-with-mysql.result == 'cancelled' || needs.test-with-mysql.result == 'failure' ||
159-
needs.test-with-mariadb.result == 'cancelled' || needs.test-with-mariadb.result == 'failure'
158+
contains( needs.*.result, 'cancelled' ) ||
159+
contains( needs.*.result, 'failure' )
160160
)
161161
162162
steps:

.github/workflows/test-and-zip-default-themes.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ jobs:
155155
needs: [ bundle-theme, test-build-scripts ]
156156
if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
157157
with:
158-
calling_status: ${{ needs.test-build-scripts.result == 'success' && needs.bundle-theme.result == 'success' && 'success' || ( needs.test-build-scripts.result == 'cancelled' || needs.bundle-theme.result == 'cancelled' ) && 'cancelled' || 'failure' }}
158+
calling_status: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }}
159159
secrets:
160160
SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }}
161161
SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }}
@@ -174,8 +174,8 @@ jobs:
174174
github.event_name != 'pull_request' &&
175175
github.run_attempt < 2 &&
176176
(
177-
needs.test-build-scripts.result == 'cancelled' || needs.test-build-scripts.result == 'failure' ||
178-
needs.bundle-theme.result == 'cancelled' || needs.bundle-theme.result == 'failure'
177+
contains( needs.*.result, 'cancelled' ) ||
178+
contains( needs.*.result, 'failure' )
179179
)
180180
181181
steps:

.github/workflows/test-coverage.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ on:
2929
permissions: {}
3030

3131
env:
32-
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: ${{ true }}
32+
PUPPETEER_SKIP_DOWNLOAD: ${{ true }}
3333
LOCAL_PHP: '7.4-fpm'
3434
LOCAL_PHP_XDEBUG: true
3535
LOCAL_PHP_XDEBUG_MODE: 'coverage'
@@ -183,7 +183,7 @@ jobs:
183183
needs: [ test-coverage-report ]
184184
if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
185185
with:
186-
calling_status: ${{ needs.test-coverage-report.result == 'success' && 'success' || needs.test-coverage-report.result == 'cancelled' && 'cancelled' || 'failure' }}
186+
calling_status: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }}
187187
secrets:
188188
SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }}
189189
SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }}
@@ -202,7 +202,8 @@ jobs:
202202
github.event_name != 'pull_request' &&
203203
github.run_attempt < 2 &&
204204
(
205-
needs.test-coverage-report.result == 'cancelled' || needs.test-coverage-report.result == 'failure'
205+
contains( needs.*.result, 'cancelled' ) ||
206+
contains( needs.*.result, 'failure' )
206207
)
207208
208209
steps:

.github/workflows/test-npm.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ concurrency:
3838
permissions: {}
3939

4040
env:
41-
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: ${{ true }}
41+
PUPPETEER_SKIP_DOWNLOAD: ${{ true }}
4242

4343
jobs:
4444
# Verifies that installing npm dependencies and building WordPress works as expected.
@@ -184,7 +184,7 @@ jobs:
184184
needs: [ test-npm, test-npm-macos ]
185185
if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
186186
with:
187-
calling_status: ${{ needs.test-npm.result == 'success' && needs.test-npm-macos.result == 'success' && 'success' || ( needs.test-npm.result == 'cancelled' || needs.test-npm-macos.result == 'cancelled' ) && 'cancelled' || 'failure' }}
187+
calling_status: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }}
188188
secrets:
189189
SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }}
190190
SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }}
@@ -203,8 +203,8 @@ jobs:
203203
github.event_name != 'pull_request' &&
204204
github.run_attempt < 2 &&
205205
(
206-
needs.test-npm.result == 'cancelled' || needs.test-npm.result == 'failure' ||
207-
needs.test-npm-macos.result == 'cancelled' || needs.test-npm-macos.result == 'failure'
206+
contains( needs.*.result, 'cancelled' ) ||
207+
contains( needs.*.result, 'failure' )
208208
)
209209
210210
steps:

0 commit comments

Comments
 (0)