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
18 changes: 6 additions & 12 deletions .github/workflows/phpunit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,8 @@ permissions: {}

jobs:
# Downloads and verifies the Gutenberg build once for all PHPUnit jobs.
#
# This condition is the union of the conditions on the jobs that need it, reduced.
# The org matrices require `WordPress/wordpress-develop` or a pull request, and the
# fork matrix requires a pull request, so `wordpress-develop` or a pull request
# covers every case. Keep it in step with those jobs: a narrower condition orphans
# them, because a job that needs a skipped job is skipped too, and a broader one
# downloads a build that nothing consumes.
prepare-gutenberg:
name: Prepare Gutenberg Assets
uses: ./.github/workflows/reusable-prepare-gutenberg.yml
permissions:
contents: read
Expand Down Expand Up @@ -144,7 +138,7 @@ jobs:
phpunit-config: ${{ matrix.multisite && 'tests/phpunit/multisite.xml' || 'phpunit.xml.dist' }}
tests-domain: ${{ matrix.tests-domain }}
report: ${{ matrix.report || false }}
gutenberg-artifact: gutenberg-build
gutenberg-artifact: ${{ needs.prepare-gutenberg.result != 'skipped' }}
gutenberg-sha: ${{ needs.prepare-gutenberg.outputs.gutenberg-sha }}

#
Expand Down Expand Up @@ -200,7 +194,7 @@ jobs:
memcached: ${{ matrix.memcached }}
phpunit-config: ${{ matrix.multisite && 'tests/phpunit/multisite.xml' || 'phpunit.xml.dist' }}
report: false
gutenberg-artifact: gutenberg-build
gutenberg-artifact: ${{ needs.prepare-gutenberg.result != 'skipped' }}
gutenberg-sha: ${{ needs.prepare-gutenberg.outputs.gutenberg-sha }}

#
Expand Down Expand Up @@ -250,7 +244,7 @@ jobs:
memcached: ${{ matrix.memcached }}
phpunit-config: ${{ matrix.multisite && 'tests/phpunit/multisite.xml' || 'phpunit.xml.dist' }}
report: false
gutenberg-artifact: gutenberg-build
gutenberg-artifact: ${{ needs.prepare-gutenberg.result != 'skipped' }}
gutenberg-sha: ${{ needs.prepare-gutenberg.outputs.gutenberg-sha }}

#
Expand Down Expand Up @@ -285,7 +279,7 @@ jobs:
db-type: ${{ matrix.db-type }}
db-version: ${{ matrix.db-version }}
phpunit-test-groups: ${{ matrix.phpunit-test-groups }}
gutenberg-artifact: gutenberg-build
gutenberg-artifact: ${{ needs.prepare-gutenberg.result != 'skipped' }}
gutenberg-sha: ${{ needs.prepare-gutenberg.outputs.gutenberg-sha }}

#
Expand Down Expand Up @@ -350,7 +344,7 @@ jobs:
memcached: ${{ matrix.memcached || false }}
phpunit-config: ${{ matrix.multisite && 'tests/phpunit/multisite.xml' || 'phpunit.xml.dist' }}
phpunit-test-groups: ${{ matrix.phpunit-test-groups || '' }}
gutenberg-artifact: gutenberg-build
gutenberg-artifact: ${{ needs.prepare-gutenberg.result != 'skipped' }}
gutenberg-sha: ${{ needs.prepare-gutenberg.outputs.gutenberg-sha }}

slack-notifications:
Expand Down
14 changes: 6 additions & 8 deletions .github/workflows/reusable-phpunit-tests-v3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ on:
type: boolean
default: false
gutenberg-artifact:
description: 'The name of a same-workflow artifact containing the prepared Gutenberg build. Optional: callers that omit it download Gutenberg per job.'
description: 'Whether the Gutenberg-sourced assets are sourced from zip artifact.'
required: false
type: string
default: ''
type: boolean
default: false
gutenberg-sha:
description: 'The immutable Gutenberg source SHA verified by the calling workflow.'
required: false
Expand Down Expand Up @@ -146,14 +146,12 @@ jobs:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
persist-credentials: false

# Branches >= 5.9 call this workflow at @trunk without the producer job, so they
# pass no artifact. They skip this step and fall back to a per-job download.
# Only WordPress 7.0+ include Gutenberg-maintained assets from a built zip file.
- name: Download prepared Gutenberg build
if: inputs.gutenberg-artifact != ''
if: ${{ inputs.gutenberg-artifact }}
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
# Without a run ID, this action reads only from the caller's current workflow run.
name: ${{ inputs.gutenberg-artifact }}
name: gutenberg-build
path: gutenberg
digest-mismatch: error

Expand Down
Loading