Skip to content

Commit 75af0d8

Browse files
committed
test: publish test results to codecov with oidc
1 parent 1448f94 commit 75af0d8

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

.github/workflows/build.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ jobs:
2323
matrix:
2424
os: [ubuntu-latest, macos-latest, windows-latest]
2525

26+
permissions:
27+
id-token: write
28+
2629
steps:
2730
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2831

@@ -53,6 +56,15 @@ jobs:
5356
- name: Codecov
5457
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
5558
with:
59+
use_oidc: true
5660
files: '**/TestResults/*/*.cobertura.xml'
5761
fail_ci_if_error: true
5862
token: ${{ secrets.CODECOV_TOKEN }}
63+
64+
- name: Codecov Test
65+
if: github.event_name != 'merge_group' && !canceled()
66+
uses: codecov/test-results-action@47f89e9acb64b76debcd5ea40642d25a4adced9f # v1.1.1
67+
with:
68+
use_oidc: true
69+
files: '**/TestResults/*/*.junit.xml'
70+
fail_ci_if_error: true

NCrontab.Advanced.Tests/NCrontab.Advanced.Tests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
<ItemGroup>
1313
<ProjectReference Include="..\NCrontab.Advanced\NCrontab.Advanced.csproj" />
14+
<PackageReference Include="JunitXml.TestLogger" Version="7.0.2" />
1415
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
1516
<PackageReference Include="MSTest.TestFramework" Version="3.11.0" />
1617
<PackageReference Include="MSTest.TestAdapter" Version="3.11.0" />

Test.runsettings

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,19 @@
3232
</DataCollectors>
3333
</DataCollectionRunSettings>
3434

35+
<LoggerRunSettings>
36+
<Loggers>
37+
<Logger friendlyName="console" enabled="True">
38+
<Configuration>
39+
<Verbosity>minimal</Verbosity>
40+
</Configuration>
41+
</Logger>
42+
<Logger friendlyName="junit" enabled="True">
43+
<Configuration>
44+
<LogFileName>{assembly}.{framework}.junit.xml</LogFileName>
45+
</Configuration>
46+
</Logger>
47+
</Loggers>
48+
</LoggerRunSettings>
3549

3650
</RunSettings>

0 commit comments

Comments
 (0)