diff --git a/.github/workflows/maturity-scorecard.yml b/.github/workflows/maturity-scorecard.yml index 4581b08beebd..04c2ea32c661 100644 --- a/.github/workflows/maturity-scorecard.yml +++ b/.github/workflows/maturity-scorecard.yml @@ -590,6 +590,16 @@ jobs: exit 1 fi + - name: Prepare aggregate QA evidence for rendering + env: + QA_EVIDENCE_PATH: ${{ steps.evidence.outputs.qa_evidence_path }} + run: | + set -euo pipefail + render_evidence_dir=".artifacts/maturity-render-evidence" + rm -rf "$render_evidence_dir" + mkdir -p "$render_evidence_dir" + install -m 0644 "$QA_EVIDENCE_PATH" "$render_evidence_dir/qa-evidence.json" + - name: Validate maturity score sources run: | node --import tsx --input-type=module <<'NODE' @@ -617,7 +627,7 @@ jobs: --output-dir .artifacts/maturity-docs \ --static-assets-dir .artifacts/maturity-docs/assets/maturity \ --scores qa/maturity-scores.yaml \ - --evidence-dir .artifacts/maturity-evidence \ + --evidence-dir .artifacts/maturity-render-evidence \ --strict-inputs \ "${allow_failures_args[@]}" { @@ -642,7 +652,7 @@ jobs: pnpm maturity:render -- \ --output-dir docs \ --scores qa/maturity-scores.yaml \ - --evidence-dir .artifacts/maturity-evidence \ + --evidence-dir .artifacts/maturity-render-evidence \ --strict-inputs \ "${allow_failures_args[@]}" diff --git a/test/scripts/ci-workflow-guards.test.ts b/test/scripts/ci-workflow-guards.test.ts index f6cdc3ee828e..9d219f492331 100644 --- a/test/scripts/ci-workflow-guards.test.ts +++ b/test/scripts/ci-workflow-guards.test.ts @@ -8122,11 +8122,25 @@ printf '%s\n' "\${CURL_SUCCESS_IP:-203.0.113.7}" }); expect(generatedPrUploadStep.with.path.trim().split("\n")).toEqual(MATURITY_GENERATED_PR_PATHS); + const prepareRenderEvidenceStep = publishJob.steps.find( + (step: WorkflowStep) => step.name === "Prepare aggregate QA evidence for rendering", + ); + expect(prepareRenderEvidenceStep.env.QA_EVIDENCE_PATH).toBe( + "${{ steps.evidence.outputs.qa_evidence_path }}", + ); + expect(prepareRenderEvidenceStep.run).toContain( + 'render_evidence_dir=".artifacts/maturity-render-evidence"', + ); + expect(prepareRenderEvidenceStep.run).toContain( + 'install -m 0644 "$QA_EVIDENCE_PATH" "$render_evidence_dir/qa-evidence.json"', + ); for (const stepName of ["Render artifact docs", "Render committed docs preview"]) { const renderStep = publishJob.steps.find((step: WorkflowStep) => step.name === stepName); expect(renderStep.env.ALLOW_FAILURES).toBe("${{ inputs.allow_failures }}"); expect(renderStep.run).toContain('[[ "$ALLOW_FAILURES" == "true" ]]'); expect(renderStep.run).toContain("allow_failures_args+=(--allow-failures)"); + expect(renderStep.run).toContain("--evidence-dir .artifacts/maturity-render-evidence"); + expect(renderStep.run).not.toContain("--evidence-dir .artifacts/maturity-evidence"); expect(renderStep.run).toContain('"${allow_failures_args[@]}"'); } const renderArtifactStep = publishJob.steps.find(