Reports JUnit, Android Lint, Detekt and any other CheckStyle compatible XML reports as GitHub Actions annotations. Mostly targeting Gradle builds
Test Suites | ✅ 93 passed | 🟡 1 skipped | ❌ 4 failed | ⌛ took |
---|---|---|---|---|
✅ org.test.sample.AnotherTestSuite
|
4 | 0 | 0 | 0.506 |
❌ org.test.sample.FlakyFailingTestSuite
|
0 | 0 | 1 | 2.07 |
1 | 0 | 0 | 1.295 | |
❌ org.test.sample.SampleTestSuite
|
1 | 1 | 2 | 0.004 |
detekt | 🛑 0 errors | 💡 0 others | |
---|---|---|---|
NewLineAtEndOfFile | 0 | 1 | 0 |
Android Lint | 🛑 0 errors | 💡 0 others | |
---|---|---|---|
Correctness / GradleDependency | 0 | 1 | 0 |
On your workflow file add:
steps:
- name: Run Gradle build
run: ./gradlew build # this is an example
- name: Report build results
uses: gmazzo/publish-report-annotations@v1 # target latest major
if: ${{ !cancelled() }}
option | usage | default |
---|---|---|
token |
The GitHub token to use to create a check (with checks: write permission).Only required if checkName is also set |
${{ github.token }} |
appId and appSecret |
The GitHub App pairs (ID and prvate key) to use to create a check (with checks: write permission).The app needs to be installed in the repo and with pull_request: read and checks: write permissionsOnly required if checkName is also set and token is not set |
None (uses token if set) |
checkName |
The name of the check to create. If not set, no check will be created and annotations will be reported to the workflow run |
None (reports to workflow run) |
workflowSummary |
Whether to report the summary to the running workflow or not. Force workflowSummary: true in conjunction with checkName to have the summary reported on both, the workflow's run and the check |
true if checkName is not set, or false otherwise |
reports |
A multiple line list of glob s pattern to look for reports |
**/build/test-results/**/*.xml **/build/reports/**/*.xml **/build/outputs/androidTest-results/**/*.xml |
testsSummary |
The kind of summary to report for tests:
|
full |
checksSummary |
The kind of summary to report into the checks
|
full |
filterPassedTests |
To reduce verbosity (and summary size), skips tests (suites and cases) that has ✅ passed from reporting into the summary | false |
filterChecks |
Reports only check's annotations coming from files that have been changed in the PR (does not affect to tests) | false |
detectFlakyTests |
Enables support for flaky tests detection (assumed the ones with the same classname and name are retries of the same test).If at least once execution of them passes, then the overall outcome will considered passed. The suite will be reported as flaky as well and the last failure will annotated as a warning |
false |
warningsAsErrors |
If any warning is reported should count as an error. Mostly used in conjunction with failOnError |
false |
failOnError |
If the action should fail if any error is reported | false |
When checkName
is set, a new check-run will be created by this actions.
If you provide appId
and appSecret
it will be used to resolve an installation token to impersonate the action as a GitHub App.
If this is not enough for your needs, you can rely on the official create-github-app-token:
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
- uses: gmazzo/publish-report-annotations@v1
with:
token: ${{ steps.app-token.outputs.token }}
For further references about how to acquire a GitHub App installation token, check the former action documentation.
The action will output the number of errors and warnings found in the reports, aggregated by tests
, checks
and totals:
output | description | example |
---|---|---|
tests |
The totals of tests |
{ "count": 8, "passed": 4, "errors": 0, "skipped": 2, "failed": 2 } |
checks |
The totals of checks |
{ "count": 12, "errors": 6, "warnings": 4, "others": 2 } |
total |
The aggregated totals | { "errors": 20, "warnings": 8, "others": 12 } |