Skip to content

Commit b3ee28a

Browse files
committed
Merge branch 'trunk' of https://github.com/sabernhardt/wordpress-develop into trunk
2 parents 8bd2df1 + e707e37 commit b3ee28a

711 files changed

Lines changed: 42778 additions & 27507 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/dependabot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,7 @@ updates:
88
schedule:
99
interval: "daily"
1010
open-pull-requests-limit: 10
11+
groups:
12+
github-actions:
13+
patterns:
14+
- "*"
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
##
2+
# A callable workflow that tests the WordPress Core build process.
3+
##
4+
name: Test the WordPress Build Process
5+
6+
on:
7+
workflow_call:
8+
inputs:
9+
os:
10+
description: 'Operating system to run tests on'
11+
required: false
12+
type: 'string'
13+
default: 'ubuntu-latest'
14+
directory:
15+
description: 'Directory to run WordPress from. Valid values are `src` or `build`'
16+
required: false
17+
type: 'string'
18+
default: 'src'
19+
20+
env:
21+
PUPPETEER_SKIP_DOWNLOAD: ${{ true }}
22+
23+
jobs:
24+
# Verifies that installing npm dependencies and building WordPress works as expected.
25+
#
26+
# Performs the following steps:
27+
# - Checks out the repository.
28+
# - Sets up Node.js.
29+
# - Logs debug information about the GitHub Action runner.
30+
# - Installs npm dependencies.
31+
# - Builds WordPress to run from the desired location (src or build).
32+
# - Ensures version-controlled files are not modified or deleted.
33+
# - Creates a ZIP of the built WordPress files (when building to the build directory).
34+
# - Cleans up after building WordPress.
35+
# - Ensures version-controlled files are not modified or deleted.
36+
# - Uploads the ZIP as a GitHub Actions artifact (when building to the build directory).
37+
build-process-tests:
38+
name: Core running from ${{ inputs.directory }} / ${{ inputs.os == 'macos-latest' && 'MacOS' || inputs.os == 'windows-latest' && 'Windows' || 'Linux' }}
39+
runs-on: ${{ inputs.os }}
40+
timeout-minutes: 20
41+
42+
steps:
43+
- name: Checkout repository
44+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
45+
with:
46+
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
47+
48+
- name: Set up Node.js
49+
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
50+
with:
51+
node-version-file: '.nvmrc'
52+
check-latest: true
53+
cache: npm
54+
55+
- name: Log debug information
56+
run: |
57+
npm --version
58+
node --version
59+
curl --version
60+
git --version
61+
62+
- name: Install npm Dependencies
63+
run: npm ci
64+
65+
- name: Build WordPress to run from ${{ inputs.directory }}
66+
run: npm run build${{ inputs.directory == 'src' && ':dev' || '' }}
67+
68+
- name: Ensure version-controlled files are not modified or deleted during building
69+
run: git diff --exit-code
70+
71+
- name: Create ZIP of built files
72+
if: ${{ inputs.directory == 'build' && 'ubuntu-latest' == inputs.os }}
73+
run: zip -r wordpress.zip build/.
74+
75+
- name: Clean after building to run from ${{ inputs.directory }}
76+
run: npm run grunt clean${{ inputs.directory == 'src' && ' -- --dev' || '' }}
77+
78+
- name: Ensure version-controlled files are not modified or deleted during cleaning
79+
run: git diff --exit-code
80+
81+
- name: Upload ZIP as a GitHub Actions artifact
82+
uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0
83+
if: ${{ inputs.directory == 'build' && 'ubuntu-latest' == inputs.os }}
84+
with:
85+
name: wordpress-build-${{ github.event_name == 'pull_request' && github.event.number || github.sha }}
86+
path: wordpress.zip
87+
if-no-files-found: error
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
##
2+
# A callable workflow that tests the Gutenberg plugin build process when run within a wordpress-develop checkout.
3+
##
4+
name: Test the Gutenberg plugin Build Process
5+
6+
on:
7+
workflow_call:
8+
inputs:
9+
os:
10+
description: 'Operating system to run tests on'
11+
required: false
12+
type: 'string'
13+
default: 'ubuntu-latest'
14+
directory:
15+
description: 'Directory to run WordPress from. Valid values are `src` or `build`'
16+
required: false
17+
type: 'string'
18+
default: 'src'
19+
20+
env:
21+
GUTENBERG_DIRECTORY: ${{ inputs.directory == 'build' && 'build' || 'src' }}/wp-content/plugins/gutenberg
22+
PUPPETEER_SKIP_DOWNLOAD: ${{ true }}
23+
NODE_OPTIONS: '--max-old-space-size=8192'
24+
25+
jobs:
26+
# Verifies that installing npm dependencies and building the Gutenberg plugin works as expected.
27+
#
28+
# Performs the following steps:
29+
# - Checks out the repository.
30+
# - Checks out the Gutenberg plugin into the plugins directory.
31+
# - Sets up Node.js.
32+
# - Logs debug information about the GitHub Action runner.
33+
# - Installs Core npm dependencies.
34+
# - Installs Gutenberg npm dependencies.
35+
# - Runs the Gutenberg build process.
36+
# - Builds WordPress to run from the relevant location (src or build).
37+
# - Builds Gutenberg.
38+
# - Ensures version-controlled files are not modified or deleted.
39+
build-process-tests:
40+
name: Gutenberg running from ${{ inputs.directory }} / ${{ inputs.os == 'macos-latest' && 'MacOS' || inputs.os == 'windows-latest' && 'Windows' || 'Linux' }}
41+
runs-on: ${{ inputs.os }}
42+
timeout-minutes: 30
43+
44+
steps:
45+
- name: Checkout repository
46+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
47+
with:
48+
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
49+
50+
- name: Checkout Gutenberg plugin
51+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
52+
with:
53+
repository: 'WordPress/gutenberg'
54+
path: ${{ env.GUTENBERG_DIRECTORY }}
55+
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
56+
57+
- name: Set up Node.js
58+
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
59+
with:
60+
node-version-file: '.nvmrc'
61+
check-latest: true
62+
cache: npm
63+
cache-dependency-path: |
64+
package-lock.json
65+
${{ env.GUTENBERG_DIRECTORY }}/package-lock.json
66+
67+
- name: Log debug information
68+
run: |
69+
npm --version
70+
node --version
71+
curl --version
72+
git --version
73+
74+
- name: Install Core Dependencies
75+
run: npm ci
76+
77+
- name: Install Gutenberg Dependencies
78+
run: npm ci
79+
working-directory: ${{ env.GUTENBERG_DIRECTORY }}
80+
81+
- name: Build Gutenberg
82+
run: npm run build
83+
working-directory: ${{ env.GUTENBERG_DIRECTORY }}
84+
85+
- name: Build WordPress to run from ${{ inputs.directory }}
86+
run: npm run build${{ inputs.directory == 'src' && ':dev' || '' }}
87+
88+
- name: Run Gutenberg build script after building Core to run from ${{ inputs.directory }}
89+
run: npm run build
90+
working-directory: ${{ env.GUTENBERG_DIRECTORY }}
91+
92+
- name: Ensure version-controlled files are not modified or deleted during building
93+
run: git diff --exit-code

.github/workflows/coding-standards.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@ jobs:
7070

7171
steps:
7272
- name: Checkout repository
73-
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
73+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
7474
with:
7575
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
7676

7777
- name: Set up PHP
78-
uses: shivammathur/setup-php@4bd44f22a98a19e0950cbad5f31095157cc9621b # v2.25.4
78+
uses: shivammathur/setup-php@e6f75134d35752277f093989e72e140eaa222f35 # v2.28.0
7979
with:
8080
php-version: 'latest'
8181
coverage: none
@@ -88,7 +88,7 @@ jobs:
8888
run: echo "date=$(/bin/date -u --date='last Mon' "+%F")" >> $GITHUB_OUTPUT
8989

9090
- name: Cache PHPCS scan cache
91-
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
91+
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
9292
with:
9393
path: |
9494
.cache/phpcs-src.json
@@ -147,12 +147,12 @@ jobs:
147147

148148
steps:
149149
- name: Checkout repository
150-
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
150+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
151151
with:
152152
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
153153

154154
- name: Set up Node.js
155-
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
155+
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
156156
with:
157157
node-version-file: '.nvmrc'
158158
cache: npm
@@ -162,7 +162,6 @@ jobs:
162162
npm --version
163163
node --version
164164
git --version
165-
svn --version
166165
167166
- name: Install npm Dependencies
168167
run: npm ci
@@ -207,7 +206,7 @@ jobs:
207206
208207
steps:
209208
- name: Dispatch workflow run
210-
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
209+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
211210
with:
212211
retries: 2
213212
retry-exempt-status-codes: 418

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

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ permissions: {}
3232

3333
env:
3434
LOCAL_DIR: build
35+
PUPPETEER_SKIP_DOWNLOAD: ${{ true }}
3536

3637
jobs:
3738
# Runs the end-to-end test suite.
@@ -42,11 +43,13 @@ jobs:
4243
# - Sets up Node.js.
4344
# - Logs debug information about the GitHub Action runner.
4445
# - Installs npm dependencies.
46+
# - Install Playwright browsers.
4547
# - Builds WordPress to run from the `build` directory.
4648
# - Starts the WordPress Docker container.
4749
# - Logs the running Docker containers.
4850
# - Logs Docker debug information (about both the Docker installation within the runner and the WordPress container).
4951
# - Install WordPress within the Docker container.
52+
# - Install Gutenberg.
5053
# - Run the E2E tests.
5154
# - Ensures version-controlled files are not modified or deleted.
5255
e2e-tests:
@@ -68,12 +71,12 @@ jobs:
6871
echo "PHP_FPM_GID=$(id -g)" >> $GITHUB_ENV
6972
7073
- name: Checkout repository
71-
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
74+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
7275
with:
7376
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
7477

7578
- name: Set up Node.js
76-
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
79+
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
7780
with:
7881
node-version-file: '.nvmrc'
7982
cache: npm
@@ -84,12 +87,14 @@ jobs:
8487
node --version
8588
curl --version
8689
git --version
87-
svn --version
8890
locale -a
8991
9092
- name: Install npm Dependencies
9193
run: npm ci
9294

95+
- name: Install Playwright browsers
96+
run: npx playwright install --with-deps
97+
9398
- name: Build WordPress
9499
run: npm run build
95100

@@ -115,37 +120,57 @@ jobs:
115120
LOCAL_SCRIPT_DEBUG: ${{ matrix.LOCAL_SCRIPT_DEBUG }}
116121
run: npm run env:install
117122

123+
- name: Install Gutenberg
124+
run: npm run env:cli -- plugin install gutenberg --path=/var/www/${{ env.LOCAL_DIR }}
125+
118126
- name: Run E2E tests
119127
run: npm run test:e2e
120128

121129
- name: Archive debug artifacts (screenshots, HTML snapshots)
122-
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
130+
uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0
123131
if: always()
124132
with:
125-
name: failures-artifacts
133+
name: failures-artifacts${{ matrix.LOCAL_SCRIPT_DEBUG && '-SCRIPT_DEBUG' || '' }}-${{ github.run_id }}
126134
path: artifacts
127135
if-no-files-found: ignore
128136

129137
- name: Ensure version-controlled files are not modified or deleted
130138
run: git diff --exit-code
131139

140+
slack-notifications:
141+
name: Slack Notifications
142+
uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk
143+
permissions:
144+
actions: read
145+
contents: read
146+
needs: [ e2e-tests ]
147+
if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
148+
with:
149+
calling_status: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }}
150+
secrets:
151+
SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }}
152+
SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }}
153+
SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }}
154+
SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }}
155+
132156
failed-workflow:
133157
name: Failed workflow tasks
134158
runs-on: ubuntu-latest
135159
permissions:
136160
actions: write
137-
needs: [ e2e-tests ]
161+
needs: [ e2e-tests, slack-notifications ]
138162
if: |
139163
always() &&
140164
github.repository == 'WordPress/wordpress-develop' &&
141165
github.event_name != 'pull_request' &&
142166
github.run_attempt < 2 &&
143167
(
144-
needs.e2e-tests.result == 'cancelled' || needs.e2e-tests.result == 'failure'
168+
contains( needs.*.result, 'cancelled' ) ||
169+
contains( needs.*.result, 'failure' )
145170
)
146171
steps:
147172
- name: Dispatch workflow run
148-
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
173+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
149174
with:
150175
retries: 2
151176
retry-exempt-status-codes: 418

.github/workflows/failed-workflow.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ jobs:
2626
runs-on: ubuntu-latest
2727
permissions:
2828
actions: write
29-
timeout-minutes: 5
29+
timeout-minutes: 30
3030

3131
steps:
3232
- name: Rerun a workflow
33-
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
33+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
3434
with:
35-
retries: 2
35+
retries: 15
3636
retry-exempt-status-codes: 418
3737
script: |
3838
const workflow_run = await github.rest.actions.getWorkflowRun({

0 commit comments

Comments
 (0)