From fd0812b0fb57c1633c3643fce8fe4c341608e252 Mon Sep 17 00:00:00 2001 From: Peter Wilson Date: Fri, 31 Jul 2026 09:16:00 +1000 Subject: [PATCH 1/5] Build WP in the prepare-gutenberg step, create artifact. --- .../workflows/reusable-prepare-gutenberg.yml | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.github/workflows/reusable-prepare-gutenberg.yml b/.github/workflows/reusable-prepare-gutenberg.yml index c5e1f904a9680..9eca84159ee11 100644 --- a/.github/workflows/reusable-prepare-gutenberg.yml +++ b/.github/workflows/reusable-prepare-gutenberg.yml @@ -58,3 +58,29 @@ jobs: if-no-files-found: error include-hidden-files: true retention-days: 1 + + - name: Install npm dependencies + run: npm ci + env: + PUPPETEER_SKIP_DOWNLOAD: true + + - name: Build WordPress + run: npm run build:dev + env: + GUTENBERG_EXPECTED_SHA: ${{ steps.download.outputs.gutenberg-sha }} + + - name: Package WordPress build + run: | + { git diff --name-only HEAD; git ls-files --others --exclude="/gutenberg/*" --exclude="/vendor/*" --exclude="/node_modules/*"; } \ + > /tmp/build-manifest.txt + echo "Files included in build artifact:" + cat /tmp/build-manifest.txt + tar -czf wordpress-build.tar.gz --files-from=/tmp/build-manifest.txt + + - name: Upload WordPress build + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: wordpress-build + path: wordpress-build.tar.gz + if-no-files-found: error + retention-days: 1 From 7514a66b1554f6abb07ddb4912bbe72b2c49dd95 Mon Sep 17 00:00:00 2001 From: Peter Wilson Date: Fri, 31 Jul 2026 09:28:00 +1000 Subject: [PATCH 2/5] Use build artifact if it exists. --- .../workflows/reusable-phpunit-tests-v3.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/reusable-phpunit-tests-v3.yml b/.github/workflows/reusable-phpunit-tests-v3.yml index 4ce4e65b0ba12..340adc3d8b384 100644 --- a/.github/workflows/reusable-phpunit-tests-v3.yml +++ b/.github/workflows/reusable-phpunit-tests-v3.yml @@ -82,6 +82,11 @@ on: required: false type: string default: '' + wordpress-build-artifact: + description: 'The name of a same-workflow artifact containing the pre-built WordPress assets. Optional: callers that omit it build per job.' + required: false + type: string + default: '' secrets: CODECOV_TOKEN: description: 'The Codecov token required for uploading reports.' @@ -186,7 +191,21 @@ jobs: - name: Install npm dependencies run: npm ci + - name: Download WordPress build + if: inputs.wordpress-build-artifact != '' + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: ${{ inputs.wordpress-build-artifact }} + path: /tmp/wordpress-build + digest-mismatch: error + + - name: Apply WordPress build + if: inputs.wordpress-build-artifact != '' + run: | + tar -xzf /tmp/wordpress-build/wordpress-build.tar.gz + - name: Build WordPress + if: inputs.wordpress-build-artifact == '' run: npm run build:dev env: # The producer resolved this once. Matrix jobs must not re-resolve mutable GHCR tags. From 0b4500a620618786cf0df79a23a5741eea084e37 Mon Sep 17 00:00:00 2001 From: Peter Wilson Date: Fri, 31 Jul 2026 09:29:25 +1000 Subject: [PATCH 3/5] Cache npm in build step. --- .github/workflows/reusable-prepare-gutenberg.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/reusable-prepare-gutenberg.yml b/.github/workflows/reusable-prepare-gutenberg.yml index 9eca84159ee11..4a05e6a77a824 100644 --- a/.github/workflows/reusable-prepare-gutenberg.yml +++ b/.github/workflows/reusable-prepare-gutenberg.yml @@ -38,6 +38,7 @@ jobs: uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: node-version-file: '.nvmrc' + cache: npm - name: Download and verify Gutenberg build id: download From 1843996e37ddeffe3a9066203230c0259a03f0bd Mon Sep 17 00:00:00 2001 From: Peter Wilson Date: Fri, 31 Jul 2026 09:35:43 +1000 Subject: [PATCH 4/5] Pass WP Build artifact to reusable workflow. --- .github/workflows/phpunit-tests.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/phpunit-tests.yml b/.github/workflows/phpunit-tests.yml index 2b9bbfe891640..b813daad793e4 100644 --- a/.github/workflows/phpunit-tests.yml +++ b/.github/workflows/phpunit-tests.yml @@ -146,6 +146,7 @@ jobs: report: ${{ matrix.report || false }} gutenberg-artifact: gutenberg-build gutenberg-sha: ${{ needs.prepare-gutenberg.outputs.gutenberg-sha }} + wordpress-build-artifact: wordpress-build # # Creates a PHPUnit test job for each PHP/MariaDB combination. @@ -202,6 +203,7 @@ jobs: report: false gutenberg-artifact: gutenberg-build gutenberg-sha: ${{ needs.prepare-gutenberg.outputs.gutenberg-sha }} + wordpress-build-artifact: wordpress-build # # Creates PHPUnit test jobs to test MariaDB and MySQL innovation releases. @@ -252,6 +254,7 @@ jobs: report: false gutenberg-artifact: gutenberg-build gutenberg-sha: ${{ needs.prepare-gutenberg.outputs.gutenberg-sha }} + wordpress-build-artifact: wordpress-build # # Runs the HTML API test group. @@ -287,6 +290,7 @@ jobs: phpunit-test-groups: ${{ matrix.phpunit-test-groups }} gutenberg-artifact: gutenberg-build gutenberg-sha: ${{ needs.prepare-gutenberg.outputs.gutenberg-sha }} + wordpress-build-artifact: wordpress-build # # Runs unit tests for forks. @@ -352,6 +356,7 @@ jobs: phpunit-test-groups: ${{ matrix.phpunit-test-groups || '' }} gutenberg-artifact: gutenberg-build gutenberg-sha: ${{ needs.prepare-gutenberg.outputs.gutenberg-sha }} + wordpress-build-artifact: wordpress-build slack-notifications: name: Slack Notifications From fc3173ecfb97f6c00a3c5215500a4ec7991f5794 Mon Sep 17 00:00:00 2001 From: Peter Wilson Date: Sat, 1 Aug 2026 09:24:21 +1000 Subject: [PATCH 5/5] Use build artifact in test coverage. --- .github/workflows/test-coverage.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-coverage.yml b/.github/workflows/test-coverage.yml index ffc650ec370fb..d83d4ce3bf13a 100644 --- a/.github/workflows/test-coverage.yml +++ b/.github/workflows/test-coverage.yml @@ -78,6 +78,7 @@ jobs: coverage-report: ${{ matrix.coverage-report }} gutenberg-artifact: gutenberg-build gutenberg-sha: ${{ needs.prepare-gutenberg.outputs.gutenberg-sha }} + wordpress-build-artifact: wordpress-build secrets: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}