Skip to content

Test report

Test report #28

Workflow file for this run

# Renders the test results produced by ci.yml as check runs on the commit.
#
# This is a separate workflow on purpose. dorny/test-reporter has to create a
# check run, and a workflow triggered by a pull request from a fork gets a
# read-only token that cannot do that. A workflow_run workflow always runs in
# the context of the base repository, with a writable token, so the report shows
# up for fork pull requests too.
# https://github.com/dorny/test-reporter#recommended-setup-for-public-repositories
name: Test report
on:
workflow_run:
workflows: [CI]
types: [completed]
permissions:
contents: read
actions: read # read the artifacts of the run that triggered this one
checks: write # create the check run holding the report
jobs:
report:
name: Test report
runs-on: ubuntu-latest
# Nothing to report when the run never got to the tests.
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event.workflow_run.conclusion == 'failure' }}
steps:
# One artifact per matrix leg (results-ps7-ubuntu-latest, ...), so the
# regex capture becomes the check name: "Tests - ps7-ubuntu-latest".
# Only failed suites and tests are listed; a full pass list is thousands
# of lines and GitHub truncates the report.
- uses: dorny/test-reporter@v3
with:
artifact: /results-(.*)/
name: 'Tests - $1'
path: testResults.xml
reporter: dotnet-nunit
list-suites: failed
list-tests: failed
use-actions-summary: 'false'
# A failed test already fails the CI run, no need to also paint this
# workflow red. fail-on-empty stays on, so a report we cannot find or
# parse is still visible instead of silently doing nothing.
fail-on-error: 'false'