From 9f650a59fd7dd4d6fb5a688fd46509303e302da5 Mon Sep 17 00:00:00 2001 From: Pierre Chalamet Date: Sun, 21 Jun 2026 12:34:20 +0200 Subject: [PATCH] Publish test results in workflows --- .github/workflows/ci-pr.yml | 13 ++++++++----- .github/workflows/on-push-branch.yml | 11 ++++++----- .github/workflows/on-push-tag.yml | 18 ++++++++++++++++++ CHANGELOG.md | 1 + 4 files changed, 33 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci-pr.yml b/.github/workflows/ci-pr.yml index 277887d..913fc63 100644 --- a/.github/workflows/ci-pr.yml +++ b/.github/workflows/ci-pr.yml @@ -13,6 +13,7 @@ on: permissions: contents: read checks: write + pull-requests: write jobs: build-and-test: @@ -53,10 +54,12 @@ jobs: if-no-files-found: warn - name: Publish test report - if: always() + if: (!cancelled()) continue-on-error: true - uses: dorny/test-reporter@v2 + uses: EnricoMi/publish-unit-test-result-action@v2 with: - name: Test Results (PR) - path: TestResults/**/*.trx - reporter: dotnet-trx + files: TestResults/**/*.trx + check_name: Test Results (PR) + comment_title: Test Results (PR) + comment_mode: always + job_summary: true diff --git a/.github/workflows/on-push-branch.yml b/.github/workflows/on-push-branch.yml index 573da1f..b07aa11 100644 --- a/.github/workflows/on-push-branch.yml +++ b/.github/workflows/on-push-branch.yml @@ -52,10 +52,11 @@ jobs: if-no-files-found: warn - name: Publish test report - if: always() + if: (!cancelled()) continue-on-error: true - uses: dorny/test-reporter@v2 + uses: EnricoMi/publish-unit-test-result-action@v2 with: - name: Test Results (Branches) - path: TestResults/**/*.trx - reporter: dotnet-trx + files: TestResults/**/*.trx + check_name: Test Results (Branches) + comment_mode: off + job_summary: true diff --git a/.github/workflows/on-push-tag.yml b/.github/workflows/on-push-tag.yml index af85ca1..ace92d6 100644 --- a/.github/workflows/on-push-tag.yml +++ b/.github/workflows/on-push-tag.yml @@ -37,6 +37,24 @@ jobs: - name: Build, test, and pack run: make publish-all config=Release version=${{ env.BUILD_VERSION }} + - name: Upload test results + if: always() + uses: actions/upload-artifact@v4 + with: + name: test-results-tag + path: TestResults/**/*.trx + if-no-files-found: warn + + - name: Publish test report + if: (!cancelled()) + continue-on-error: true + uses: EnricoMi/publish-unit-test-result-action@v2 + with: + files: TestResults/**/*.trx + check_name: Test Results (Tag) + comment_mode: off + job_summary: true + - name: Extract release notes from changelog shell: bash run: ./.github/scripts/extract-release-notes.sh "${GITHUB_REF_NAME}" > "${RUNNER_TEMP}/release-notes.md" diff --git a/CHANGELOG.md b/CHANGELOG.md index 455d139..b428e6b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ All notable changes to FSharp.MongoDB are documented in this file. ## [Unreleased] +- Added GitHub test result publishing across PR, branch, and tag workflows, including Actions job summaries and PR comments. - Updated the repository and GitHub Actions workflows to use the .NET SDK `10.0.301` baseline. - Restored the isomorphic serialization test coverage to guard C# and F# BSON parity again.