From 480f6f3afc6fc27fda907ff1acc8574790d51296 Mon Sep 17 00:00:00 2001 From: Gabriel Weyer Date: Sun, 27 Aug 2023 11:28:25 +1000 Subject: [PATCH] Use GitHub Actions Job Summary [skip-release] --- .github/workflows/build.yml | 8 -------- .nuke/build.schema.json | 4 ++-- Directory.Packages.props | 1 + build/Build.cs | 14 +++++++++++++- tests/XsltTests/XsltTests.csproj | 4 ++++ 5 files changed, 20 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1b97783..4bfe952 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -69,14 +69,6 @@ jobs: with: name: coverage path: ./artifacts/coverage-report - - name: Report test results - uses: dorny/test-reporter@v1.6.0 - continue-on-error: true - if: ${{ always() }} - with: - name: Test results - path: 'artifacts/test-results/**/*.trx' - reporter: dotnet-trx - name: Determine if we're skipping release on feature Pull Request if: ${{ env.IS_FEATURE_PULL_REQUEST == 'true' }} run: | diff --git a/.nuke/build.schema.json b/.nuke/build.schema.json index 99395b4..179d230 100644 --- a/.nuke/build.schema.json +++ b/.nuke/build.schema.json @@ -1,7 +1,7 @@ { "$schema": "http://json-schema.org/draft-04/schema#", - "title": "Build Schema", "$ref": "#/definitions/build", + "title": "Build Schema", "definitions": { "build": { "type": "object", @@ -121,4 +121,4 @@ } } } -} \ No newline at end of file +} diff --git a/Directory.Packages.props b/Directory.Packages.props index 276384b..f389897 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -10,6 +10,7 @@ + diff --git a/build/Build.cs b/build/Build.cs index 055f830..4fff4b8 100644 --- a/build/Build.cs +++ b/build/Build.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Linq; using Nuke.Common; using Nuke.Common.CI; @@ -111,11 +112,22 @@ from framework in testProject.GetTargetFrameworks() var testResultsName = $"{p.TestProject.Path.NameWithoutExtension}-{p.Framework}"; var testResultsDirectory = TestResultsDirectory / testResultsName; + var loggers = new List + { + $"trx;LogFileName={testResultsName}.trx", + $"html;LogFileName={testResultsName}.html" + }; + + if (IsServerBuild) + { + loggers.Add($"GitHubActions;annotations.titleFormat=$test ({p.Framework})"); + } + return ss .SetProjectFile(p.TestProject) .SetFramework(p.Framework) .SetResultsDirectory(testResultsDirectory) - .SetLoggers($"trx;LogFileName={testResultsName}.trx", $"html;LogFileName={testResultsName}.html"); + .SetLoggers(loggers); }), completeOnFailure: true); }); diff --git a/tests/XsltTests/XsltTests.csproj b/tests/XsltTests/XsltTests.csproj index f6a6072..e58db8f 100644 --- a/tests/XsltTests/XsltTests.csproj +++ b/tests/XsltTests/XsltTests.csproj @@ -19,6 +19,10 @@ all + + runtime; build; native; contentfiles; analyzers; buildtransitive + all +