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
if: always() ensures artifacts are uploaded even when tests fail, which is exactly when you need them most.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.