diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7018a38120..12b6771ead 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -201,6 +201,9 @@ jobs: permissions: contents: read uses: ./.github/workflows/coverage-aggregate.yml + with: + download_vitest_coverage: ${{ needs.frontend-validation.result == 'success' }} + download_playwright_coverage: ${{ needs.playwright-e2e-live.result == 'success' }} secrets: inherit # Single status check that branch protection should mark as required. diff --git a/.github/workflows/coverage-aggregate.yml b/.github/workflows/coverage-aggregate.yml index bbfaf09363..5edfacf07a 100644 --- a/.github/workflows/coverage-aggregate.yml +++ b/.github/workflows/coverage-aggregate.yml @@ -13,6 +13,17 @@ name: Aggregate backend coverage # producers themselves on: workflow_call: + inputs: + download_vitest_coverage: + description: Download the frontend-validation coverage artifact when available. + required: false + type: boolean + default: true + download_playwright_coverage: + description: Download the e2e-live Playwright coverage artifact when available. + required: false + type: boolean + default: true permissions: contents: read @@ -198,7 +209,7 @@ jobs: # frontend-validation uploads as `frontend-coverage`. Tolerate # absence so a backend-only PR still produces the matrix with # just backend rows populated. - if: always() + if: always() && inputs.download_vitest_coverage uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v6.0.0 with: name: frontend-coverage @@ -206,12 +217,12 @@ jobs: continue-on-error: true - name: Download Playwright frontend coverage artifact - # e2e-live uploads as `playwright-frontend-coverage-`. + # e2e-live uploads the artifact with a stable name. # Same tolerance as vitest - matrix script handles missing inputs. - if: always() + if: always() && inputs.download_playwright_coverage uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v6.0.0 with: - name: playwright-frontend-coverage-${{ github.run_id }} + name: playwright-frontend-coverage path: matrix-inputs/playwright/ continue-on-error: true diff --git a/.github/workflows/e2e-live.yml b/.github/workflows/e2e-live.yml index eb6d8d7be5..44d5443a73 100644 --- a/.github/workflows/e2e-live.yml +++ b/.github/workflows/e2e-live.yml @@ -169,7 +169,7 @@ jobs: if: always() && steps.pw-frontend-coverage.outputs.summary == 'true' uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: - name: playwright-frontend-coverage-${{ github.run_id }} + name: playwright-frontend-coverage path: | .test-state/playwright/coverage-pw-summary/ .test-state/playwright/coverage-pw/