diff --git a/.github/workflows/phpunit-tests.yml b/.github/workflows/phpunit-tests.yml index 2b9bbfe891640..94a2ddf187d9e 100644 --- a/.github/workflows/phpunit-tests.yml +++ b/.github/workflows/phpunit-tests.yml @@ -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 @@ -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 }} # @@ -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 }} # @@ -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 }} # @@ -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 }} # @@ -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: diff --git a/.github/workflows/reusable-phpunit-tests-v3.yml b/.github/workflows/reusable-phpunit-tests-v3.yml index 6a7f49fba468c..1c09113810dd3 100644 --- a/.github/workflows/reusable-phpunit-tests-v3.yml +++ b/.github/workflows/reusable-phpunit-tests-v3.yml @@ -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 @@ -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