CI Test Artifacts Keep Expiring? Here's the Fix

You’re debugging a production issue. You remember a test failed with the same error three months ago. You go to find that test report… and it’s gone. The CI artifacts expired. Sound familiar?

Why CI Providers Delete Your Test Artifacts

Every major CI/CD platform automatically deletes artifacts after a retention period:

CI ProviderDefault RetentionMax Retention
GitHub Actions90 days400 days (paid)
GitLab CI30 daysConfigurable
CircleCI30 days30 days
Azure DevOps30 daysConfigurable
Bitbucket Pipelines14 days14 days

Why do they do this? Storage costs money. CI providers optimize for build speed and compute, not long-term artifact storage. Your test reports are considered disposable.

The Real Cost of Expiring Artifacts

Losing test artifacts isn’t just annoying—it has real consequences:

1. Debugging Becomes Harder

When a bug resurfaces, historical test data is invaluable. Which tests were failing before we “fixed” this? What did the error message say? Without the original artifacts, you’re starting from scratch.

2. Flaky Test Analysis is Impossible

To understand flaky tests, you need data across many runs. If artifacts expire after 30 days, you lose the historical context needed to identify patterns.

3. Compliance Requirements

Regulated industries (finance, healthcare, automotive) often require test evidence retention for years. CI artifact expiration violates these requirements.

4. Onboarding Suffers

New team members can’t see how the test suite evolved. They can’t reference past failures to understand why certain tests exist.

5. Post-Mortems Lack Evidence

“What went wrong?” is hard to answer when the test reports from the incident are gone.

Workarounds (and Why They Fall Short)

Increase CI Retention

Some CI providers let you extend retention. GitHub Actions goes up to 400 days with paid plans. But:

  • Still not permanent
  • Expensive at scale (GitHub charges for storage)
  • Doesn’t solve the access problem (finding artifacts is still tedious)

Upload to S3/GCS

You can add a CI step to upload artifacts to your own cloud storage:

- name: Upload to S3
  run: aws s3 cp ./test-results s3://my-bucket/reports/${{ github.sha }} --recursive

Problems:

  • Manual setup and maintenance
  • No built-in access control
  • No UI for browsing reports
  • Still need to manage storage costs and cleanup

Save Locally

Some teams download important artifacts before they expire. This doesn’t scale and relies on someone remembering to do it.

The Real Solution: Dedicated Test Report Hosting

Instead of fighting CI artifact limits, host your test reports on a platform designed for it:

  1. Automatic upload from CI pipeline
  2. Configurable retention per project, with optional permanent storage
  3. Instant access via shareable URLs
  4. Team-based permissions tied to your organization
  5. Search and analytics across all historical runs

How Gaffer Solves CI Artifact Expiration

Gaffer is purpose-built for test report hosting. Here’s how it works:

Step 1: Add One Line to CI

GitHub Actions:

- name: Upload to Gaffer
  if: always()
  uses: gaffer-sh/gaffer-uploader@v2
  with:
    api-key: ${{ secrets.GAFFER_API_KEY }}
    report-path: ./test-results

Any CI with curl:

curl -X POST https://api.gaffer.sh/upload \
  -H "X-API-Key: $GAFFER_API_KEY" \
  -F "files=@test-results/report.html" \
  -F "branch=$CI_BRANCH" \
  -F "commit=$CI_COMMIT_SHA"

Step 2: Choose Your Retention

Every upload gets a permanent URL. You control how long reports are kept:

PlanDefault RetentionPer-Project Settings
Free7 daysCustom retention periods
Pro30 daysCustom + unlimited option
Team90 daysCustom + unlimited option

Paid plans can disable automatic cleanup entirely for unlimited retention. This is ideal for compliance requirements or when you need long-term historical data.

Want to keep costs low? Enable automatic cleanup and set a shorter retention period. Test reports from feature branches might only need 7 days, while production test data could be kept longer.

Step 3: Access Anytime

  • Browse reports in the Gaffer dashboard
  • Search by branch, commit, date range
  • Share links with teammates
  • Get Slack notifications with direct links

Per-Project Retention Control

Different projects have different needs. Gaffer lets you configure retention per-project:

  • Production tests: Keep forever (disable cleanup on paid plans)
  • Feature branch tests: Auto-delete after 7 days
  • Compliance-critical projects: Match your regulatory requirements

All plans can set custom retention periods. Paid plans unlock the “never delete” option for permanent storage.

Beyond Storage: Analytics Over Time

When you keep all your test data, you unlock insights that expiring artifacts make impossible:

  • Pass rate trends - Is the suite getting more stable?
  • Flaky test detection - Which tests fail intermittently?
  • Regression detection - When did this test start failing?
  • Duration trends - Are tests getting slower?

Migration Path

Already have test reports scattered across CI providers? Gaffer works alongside your existing setup:

  1. Add Gaffer upload to CI (takes 5 minutes)
  2. New reports go to Gaffer automatically
  3. Old reports in CI continue to expire (nothing changes)
  4. Over time, Gaffer becomes your source of truth

No migration, no data import, just better going forward.

Get Started

Stop losing test artifacts. Gaffer gives you control over retention with per-project settings. Paid plans can disable cleanup entirely for permanent storage - you only pay for the storage you use.