Skip to content

Commit bc51877

Browse files
authored
Publish test results in workflows (#36)
1 parent f407798 commit bc51877

4 files changed

Lines changed: 33 additions & 10 deletions

File tree

.github/workflows/ci-pr.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ on:
1313
permissions:
1414
contents: read
1515
checks: write
16+
pull-requests: write
1617

1718
jobs:
1819
build-and-test:
@@ -53,10 +54,12 @@ jobs:
5354
if-no-files-found: warn
5455

5556
- name: Publish test report
56-
if: always()
57+
if: (!cancelled())
5758
continue-on-error: true
58-
uses: dorny/test-reporter@v2
59+
uses: EnricoMi/publish-unit-test-result-action@v2
5960
with:
60-
name: Test Results (PR)
61-
path: TestResults/**/*.trx
62-
reporter: dotnet-trx
61+
files: TestResults/**/*.trx
62+
check_name: Test Results (PR)
63+
comment_title: Test Results (PR)
64+
comment_mode: always
65+
job_summary: true

.github/workflows/on-push-branch.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,11 @@ jobs:
5252
if-no-files-found: warn
5353

5454
- name: Publish test report
55-
if: always()
55+
if: (!cancelled())
5656
continue-on-error: true
57-
uses: dorny/test-reporter@v2
57+
uses: EnricoMi/publish-unit-test-result-action@v2
5858
with:
59-
name: Test Results (Branches)
60-
path: TestResults/**/*.trx
61-
reporter: dotnet-trx
59+
files: TestResults/**/*.trx
60+
check_name: Test Results (Branches)
61+
comment_mode: off
62+
job_summary: true

.github/workflows/on-push-tag.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,24 @@ jobs:
3737
- name: Build, test, and pack
3838
run: make publish-all config=Release version=${{ env.BUILD_VERSION }}
3939

40+
- name: Upload test results
41+
if: always()
42+
uses: actions/upload-artifact@v4
43+
with:
44+
name: test-results-tag
45+
path: TestResults/**/*.trx
46+
if-no-files-found: warn
47+
48+
- name: Publish test report
49+
if: (!cancelled())
50+
continue-on-error: true
51+
uses: EnricoMi/publish-unit-test-result-action@v2
52+
with:
53+
files: TestResults/**/*.trx
54+
check_name: Test Results (Tag)
55+
comment_mode: off
56+
job_summary: true
57+
4058
- name: Extract release notes from changelog
4159
shell: bash
4260
run: ./.github/scripts/extract-release-notes.sh "${GITHUB_REF_NAME}" > "${RUNNER_TEMP}/release-notes.md"

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ All notable changes to FSharp.MongoDB are documented in this file.
44

55
## [Unreleased]
66

7+
- Added GitHub test result publishing across PR, branch, and tag workflows, including Actions job summaries and PR comments.
78
- Updated the repository and GitHub Actions workflows to use the .NET SDK `10.0.301` baseline.
89
- Restored the isomorphic serialization test coverage to guard C# and F# BSON parity again.
910

0 commit comments

Comments
 (0)