Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/phpunit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/reusable-phpunit-tests-v3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.'
Expand Down Expand Up @@ -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.
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/reusable-prepare-gutenberg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -58,3 +59,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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reusable workflow also serves test-coverage.yml, whose two coverage jobs do not pass wordpress-build-artifact

In this PR’s Code Coverage run, this step built WordPress in prepare-gutenberg, then both coverage jobs received an empty input and ran their fallback builds too. That adds a serial build and artifact upload without replacing either child build.

Could we pass wordpress-build from test-coverage.yml, or make this producer work opt-in?


AI use: prepared with gpt-5.6-sol

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated test-coverage accordingly in fc3173e

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
1 change: 1 addition & 0 deletions .github/workflows/test-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand Down
Loading