This GitHub Action automatically finds and uploads test report files (XML, JSON etc.) as GitHub artifacts.
It is designed to work with most CI pipelines without requiring any repo-specific configuration.
Add this step at the end of your test job. Always use if: always() so results are collected even if tests fail.
- name: Store Test Results for Smart Tests
if: always()
uses: cloudbees-oss/smart-tests-results-upload-action@v1- name: Store Test Results for Smart Tests
if: always()
uses: cloudbees-oss/smart-tests-results-upload-action@v1
with:
files: |
**/*.xml
**/*.json
days: 7| Input | Default | Description |
|---|---|---|
| files | **/*.xml, **/*.json |
Glob patterns used to find test report files |
| days | 21 |
Artifact retention period in days |
- Recursively scans the workspace for matching test report files
- Uploads all matched files as a single GitHub artifact
- Runs even if tests fail (
if: always())
Each run generates a unique artifact name:
test-artifacts-<job>-<run_id>-<run_attempt>
This prevents collisions across parallel jobs and retries.
- This action does not generate test reports
- It only collects existing files from the CI workspace
- Works best with standard test outputs like XML or JSON
- No additional setup is required in most projects
- JUnit XML
- Jest / Mocha JSON reports
- Playwright JSON output
- .NET TRX files
- TAP reports
Apache-2.0