Background
Our existing CI pipeline uses two primary jobs:| Job Name | Artifact Name | Description |
|---|---|---|
| unit-test | test-reports | Runs unit tests and exports JUnit XML |
| code-coverage | coverage-report | Generates coverage data (lcov) |
Artifacts are retained for up to 90 days and can be no larger than 5 GB each. Syncing reports to S3 immediately after CI avoids expiration and size caps.
Solution Overview
- Extend (or create) a workflow that triggers when the primary CI run completes.
- Download the
test-reportsandcoverage-reportartifacts. - Use an S3 sync action to upload all reports to your S3 bucket.
Workflow Configuration
Add a new file at.github/workflows/report-storage.yml:
Make sure you’ve defined the following secrets under Settings > Secrets and variables > Actions:
S3_BUCKETAWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEY
The
workflow_run trigger ensures the upload job only runs after the CI workflow has completed successfully.Next Steps
- Commit and push
report-storage.ymlto your repository. - Confirm that
unit-testandcode-coveragejobs publish artifacts namedtest-reportsandcoverage-report. - Trigger your CI workflow and verify the
reports/directory appears in your S3 bucket.