Artifacts, Logs and Failure Debugging

Even with good tests, pipelines will fail, and your ability to debug those failures quickly depends on how well you capture artifacts and logs. GitHub Actions supports uploading test reports, screenshots, videos and other files for later inspection.

Capturing Artifacts and Logs from Test Runs

Artifacts are files attached to a workflow run that you can download from the GitHub UI, such as JUnit XML, HTML reports or screenshots. Logs include step output from each job and are browsable directly in the Actions interface.

# Example: uploading artifacts for later debugging
jobs:
  e2e:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
      - name: Install deps
        run: npm ci
      - name: Run Playwright tests
        run: npx playwright test --reporter=junit,line --output=playwright-report
      - name: Upload test report
        if: always()
        uses: actions/upload-artifact@v4
        with:
          name: playwright-report
          path: playwright-report
Note: Using if: always() ensures artifacts are uploaded even when tests fail, which is exactly when you need them most.
Tip: Standardise artifact names and locations so the team always knows where to look for reports and logs.
Warning: Not capturing artifacts forces people to reproduce failures locally, which can be slow or impossible in some environments.

Over time, you can connect these artifacts to external dashboards or reporting tools to see trends and recurring issues.

Common Mistakes

Mistake 1 โ€” Uploading no artifacts at all

This slows triage.

โŒ Wrong: Only relying on console logs when UI tests fail.

โœ… Correct: Upload structured reports, screenshots and videos when failures happen.

Mistake 2 โ€” Collecting artifacts but never using them

This wastes storage.

โŒ Wrong: Saving large artifacts indefinitely without reviewing or cleaning up.

โœ… Correct: Review artifacts during triage and define retention policies that balance usefulness with cost.

🧠 Test Yourself

Why should you configure artifact uploads for failing tests?