-
-
Notifications
You must be signed in to change notification settings - Fork 478
44 lines (41 loc) · 1.79 KB
/
Copy pathtest-report.yml
File metadata and controls
44 lines (41 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# 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'