From 1b26e06fe76138c9e98e15d04800d5c37da82188 Mon Sep 17 00:00:00 2001 From: Rasmus Mikkelsen Date: Thu, 24 Feb 2022 17:33:25 +0100 Subject: [PATCH] .NET test results (#78) --- .github/workflows/pull-requests.yml | 8 ++++++++ .github/workflows/release.yml | 8 ++++++++ .github/workflows/test-reports.yml | 19 +++++++++++++++++++ RELEASE_NOTES.md | 2 ++ Source/Bake/Services/Tools/DotNet.cs | 1 + 5 files changed, 38 insertions(+) create mode 100644 .github/workflows/test-reports.yml diff --git a/.github/workflows/pull-requests.yml b/.github/workflows/pull-requests.yml index 8ca9ed27..915c8f67 100644 --- a/.github/workflows/pull-requests.yml +++ b/.github/workflows/pull-requests.yml @@ -58,3 +58,11 @@ jobs: - name: Run Bake run: bake-it/bake run --build-version 0.11.$GITHUB_RUN_NUMBER + + - name: Upload test results + uses: actions/upload-artifact@v2 + if: success() || failure() + with: + name: test-results + path: "**/*.trx" + if-no-files-found: error diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 34ba35bb..65da5d3e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -58,3 +58,11 @@ jobs: - name: Run Bake run: bake-it/bake run --convention=Release --build-version 0.11.$GITHUB_RUN_NUMBER --destination="nuget>github,nuget,release>github" + + - name: Upload test results + uses: actions/upload-artifact@v2 + if: success() || failure() + with: + name: test-results + path: "**/*.trx" + if-no-files-found: error diff --git a/.github/workflows/test-reports.yml b/.github/workflows/test-reports.yml new file mode 100644 index 00000000..94acc945 --- /dev/null +++ b/.github/workflows/test-reports.yml @@ -0,0 +1,19 @@ +name: test-report +on: + workflow_run: + workflows: + - 'pull-requests' + - 'release' + types: + - completed + +jobs: + report: + runs-on: ubuntu-latest + steps: + - uses: dorny/test-reporter@v1 + with: + artifact: test-results + name: Test results + path: '**/*.trx' + reporter: dotnet-trx diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 16e097cf..16cac55e 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,6 +1,8 @@ # 0.11-beta * New: Use content of `README.md` files as DLL and NuGet descriptions +* New: .NET test reports are now saved as `.trx` files allow artifact uploads + to pick these up after build completion * Fixed: Bake is now better at picking release notes with versions that are *similar* to the build version if no exact match can be found. As an example `1.0-alpha` is picked among `1.1`, `1.0-alpha` and `0.9` diff --git a/Source/Bake/Services/Tools/DotNet.cs b/Source/Bake/Services/Tools/DotNet.cs index 798688a8..18f49303 100644 --- a/Source/Bake/Services/Tools/DotNet.cs +++ b/Source/Bake/Services/Tools/DotNet.cs @@ -162,6 +162,7 @@ public async Task TestAsync( argument.FilePath, "--nologo", "--configuration", argument.Configuration, + "--logger", "\"trx;LogFileName=test-results.trx\"" }; AddIf(!argument.Restore, arguments, "--no-restore");