Skip to content

Commit ced62b7

Browse files
committed
Add generation and reporting of test results
1 parent 78b3e25 commit ced62b7

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-2
lines changed

.github/workflows/BuildAndPack.yml

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,31 @@ jobs:
6161
MSBuildEnableWorkloadResolver: false
6262
- uses: actions/upload-artifact@v4
6363
with:
64-
name: artifacts-${{ matrix.os }}
65-
path: artifacts
64+
name: packages-${{ matrix.os }}
65+
path: artifacts/packages
66+
- uses: actions/upload-artifact@v4
67+
with:
68+
name: results-${{ matrix.os }}
69+
path: artifacts/results
70+
71+
publish-test-results:
72+
name: "Publish Tests Results"
73+
needs: build-and-test
74+
runs-on: ubuntu-latest
75+
permissions:
76+
checks: write
77+
pull-requests: write # needed unless run with comment_mode: off
78+
# contents: read # only needed for private repository
79+
# issues: read # only needed for private repository
80+
if: always()
81+
82+
steps:
83+
- name: Download Artifacts
84+
uses: actions/download-artifact@v4
85+
with:
86+
path: artifacts/results
87+
88+
- name: Publish Test Results
89+
uses: EnricoMi/publish-unit-test-result-action@v2
90+
with:
91+
files: "artifacts/**/*.xml"

build/Build.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ class Build : NukeBuild
7575
DotNetTest(s => s
7676
.SetProjectFile(Solution)
7777
.SetConfiguration(Configuration)
78+
.When(IsServerBuild, x => x
79+
.SetLoggers("trx")
80+
.SetResultsDirectory(ArtifactsDirectory / "results"))
7881
.EnableNoBuild()
7982
.EnableNoRestore());
8083
});

0 commit comments

Comments
 (0)