Skip to content

Commit 5e2e6fc

Browse files
Add test analytics
Use Codecov's test analytics feature.
1 parent 80276e3 commit 5e2e6fc

File tree

5 files changed

+12
-3
lines changed

5 files changed

+12
-3
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,13 @@ jobs:
9999
- name: Upload coverage to Codecov
100100
uses: codecov/codecov-action@ad3126e916f78f00edff4ed0317cf185271ccc2d # v5.4.2
101101
with:
102-
files: ./artifacts/coverage/coverage.cobertura.xml
102+
flags: ${{ runner.os }}
103+
token: ${{ secrets.CODECOV_TOKEN }}
104+
105+
- name: Upload test results to Codecov
106+
uses: codecov/test-results-action@f2dba722c67b86c6caa034178c6e4d35335f6706 # v1.1.0
107+
if: ${{ !cancelled() }}
108+
with:
103109
flags: ${{ runner.os }}
104110
token: ${{ secrets.CODECOV_TOKEN }}
105111

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
BenchmarkDotNet.Artifacts*/
66
coverage
77
coverage.*
8+
junit.xml
89
node_modules/
910
*.binlog
1011
*.user

Directory.Build.targets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<ItemGroup Condition=" '$(IsTestProject)' == 'true' ">
99
<PackageReference Include="coverlet.msbuild" PrivateAssets="All" />
1010
<PackageReference Include="GitHubActionsTestLogger" PrivateAssets="All" />
11+
<PackageReference Include="JunitXml.TestLogger" PrivateAssets="All" />
1112
<PackageReference Include="ReportGenerator" PrivateAssets="All" />
1213
</ItemGroup>
1314
<PropertyGroup Condition=" '$(CollectCoverage)' == 'true' ">

Directory.Packages.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<PackageVersion Include="GitHubActionsTestLogger" Version="2.4.1" />
77
<PackageVersion Include="IdentityServer4" Version="3.1.4" />
88
<PackageVersion Include="IdentityServer4.AccessTokenValidation" Version="3.0.1" />
9+
<PackageVersion Include="JunitXml.TestLogger" Version="6.1.0" />
910
<PackageVersion Include="Microsoft.AspNetCore" Version="2.3.0" />
1011
<PackageVersion Include="Microsoft.AspNetCore.Mvc.ApiExplorer" Version="2.3.0" />
1112
<PackageVersion Include="Microsoft.AspNetCore.Mvc.DataAnnotations" Version="2.3.0" />

build.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ if ($LASTEXITCODE -ne 0) {
1919
$additionalArgs = @()
2020

2121
if (![string]::IsNullOrEmpty($env:GITHUB_SHA)) {
22-
$additionalArgs += "--logger"
23-
$additionalArgs += "GitHubActions;report-warnings=false"
22+
$additionalArgs += "--logger:GitHubActions;report-warnings=false"
23+
$additionalArgs += "--logger:junit;LogFilePath=junit.xml"
2424
}
2525

2626
dotnet test --configuration $Configuration $additionalArgs

0 commit comments

Comments
 (0)