Skip to content

Commit dfec59d

Browse files
shanselmanCopilot
andauthored
ci: collect coverage and upload test results in CI (#160)
Enable XPlat Code Coverage and TRX logs for both test projects in the CI test job, and upload the combined TestResults artifact on every run. Co-authored-by: Copilot <[email protected]>
1 parent 5e39f26 commit dfec59d

File tree

1 file changed

+27
-4
lines changed

1 file changed

+27
-4
lines changed

.github/workflows/ci.yml

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,33 @@ jobs:
5050
dotnet build tests/OpenClaw.Shared.Tests -c Debug
5151
dotnet build tests/OpenClaw.Tray.Tests -c Debug
5252
53-
- name: Run Tests
54-
run: |
55-
dotnet test tests/OpenClaw.Shared.Tests --no-build -c Debug --verbosity normal
56-
dotnet test tests/OpenClaw.Tray.Tests --no-build -c Debug --verbosity normal
53+
- name: Run Shared Tests
54+
run: >
55+
dotnet test tests/OpenClaw.Shared.Tests
56+
--no-build
57+
-c Debug
58+
--verbosity normal
59+
--collect:"XPlat Code Coverage"
60+
--results-directory TestResults\Shared
61+
--logger "trx;LogFileName=OpenClaw.Shared.Tests.trx"
62+
63+
- name: Run Tray Tests
64+
run: >
65+
dotnet test tests/OpenClaw.Tray.Tests
66+
--no-build
67+
-c Debug
68+
--verbosity normal
69+
--collect:"XPlat Code Coverage"
70+
--results-directory TestResults\Tray
71+
--logger "trx;LogFileName=OpenClaw.Tray.Tests.trx"
72+
73+
- name: Upload Test Results
74+
if: always()
75+
uses: actions/upload-artifact@v4
76+
with:
77+
name: test-results
78+
path: TestResults/
79+
if-no-files-found: warn
5780

5881
outputs:
5982
semVer: ${{ steps.gitversion.outputs.semVer }}

0 commit comments

Comments
 (0)