Make frontend coverage download conditional
Add inputs to the coverage-aggregate workflow to control downloading frontend coverage artifacts (download_vitest_coverage, download_playwright_coverage) and default them to true. Update build.yml to pass those flags based on frontend-validation and playwright-e2e-live job results. Guard artifact download steps with the new inputs and standardize the Playwright artifact name to a stable value (playwright-frontend-coverage). Continue-on-error behavior retained so backend-only PRs remain resilient.
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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-<run_id>`.
|
||||
# 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
|
||||
|
||||
|
||||
@@ -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/
|
||||
|
||||
Reference in New Issue
Block a user