5. Artifacts, reports & debugging CI
CI/CD Pipelines · 48 pages source format
When CI fails, artifacts (test reports, screenshots, traces) tell the story. Upload on failure; retention policies matter.
What you'll learn
- upload-artifact
- Download artifacts
- Retention days
- Re-running jobs
Upload test report
actions/upload-artifact@v4 with if: failure() — HTML report, screenshots, logs.
- uses: actions/upload-artifact@v4
if: failure()
with:
name: test-report
path: reports/
retention-days: 14Do this now
Configure artifact upload on test failure. Download from Actions UI.
Always upload on main failures
PR failures optional; main branch failures always retain artifacts for postmortem.
Do this now
Different retention or always-upload policy for main — document in CI.md.
Debug locally with act (optional)
nektos/act runs Actions locally — imperfect but useful for fast iteration.
Do this now
Try act once OR document "re-run failed jobs" as primary debug path.
CI.md runbook
How to read logs, download artifacts, re-run, who to ping.
Do this now
Write CI.md debug section — 10 bullets.