Skip to content

Commit

Permalink
Use GitHub Actions Job Summary
Browse files Browse the repository at this point in the history
[skip-release]
  • Loading branch information
gabrielweyer committed Aug 27, 2023
1 parent 4f3c6fe commit e6c2a1c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
8 changes: 0 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,6 @@ jobs:
with:
name: coverage
path: ./artifacts/coverage-report
- name: Report test results
uses: dorny/[email protected]
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: |
Expand Down
1 change: 1 addition & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.1.1" />
<PackageVersion Include="coverlet.collector" Version="6.0.0" />
<PackageVersion Include="FluentAssertions" Version="6.12.0" />
<PackageVersion Include="GitHubActionsTestLogger" Version="2.3.3" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.7.1" />
<PackageVersion Include="xunit" Version="2.5.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.4.5" Condition="'$(TargetFramework)' == 'netcoreapp3.1'" />
Expand Down
14 changes: 13 additions & 1 deletion build/Build.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Nuke.Common;
using Nuke.Common.CI;
Expand Down Expand Up @@ -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<string>
{
$"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);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="FluentAssertions" />
<PackageReference Include="GitHubActionsTestLogger">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="xunit" />
<PackageReference Include="xunit.runner.visualstudio">
Expand Down

0 comments on commit e6c2a1c

Please sign in to comment.