Manuals / CI/CD Pipelines / Ch 5

B · Security & ConfigIntermediate55 min read

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: 14

Do this now

Configure artifact upload on test failure. Download from Actions UI.

Clear?

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.

Clear?

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.

Clear?

CI.md runbook

How to read logs, download artifacts, re-run, who to ping.

Do this now

Write CI.md debug section — 10 bullets.

Clear?

Checklist