Skip to content

Commit 3bed945

Browse files
authored
Merge pull request #276 from xt0rted/test-results
Use GitHubActionsTestLogger to report test results
2 parents 1a260b5 + 8a690af commit 3bed945

File tree

5 files changed

+21
-47
lines changed

5 files changed

+21
-47
lines changed

.github/dependabot.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ updates:
3636
- "System.IO.Abstractions.TestingHelpers"
3737
testing:
3838
patterns:
39-
- "coverlet.collector"
4039
- "FakeItEasy"
4140
- "FakeItEasy.*"
41+
- "GitHubActionsTestLogger"
4242
- "Microsoft.NET.Test.Sdk"
4343
- "Shouldly"
4444
- "Verify.Xunit"

.github/workflows/ci.yml

+6-5
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ jobs:
6363

6464
- run: dotnet r build
6565

66-
- run: dotnet r test -- --logger "trx;LogFilePrefix=${{ matrix.os }}"
66+
- run: dotnet r test -- --no-build --logger GitHubActions
6767

68-
- run: dotnet r pack -- --version-suffix ${{ env.VERSION_SUFFIX }}
68+
- run: dotnet r pack -- --no-build --version-suffix ${{ env.VERSION_SUFFIX }}
6969

7070
- name: Upload artifacts
7171
uses: actions/[email protected]
@@ -75,11 +75,12 @@ jobs:
7575
path: ./artifacts/*.nupkg
7676

7777
- name: Upload test results
78+
if: failure()
7879
uses: actions/[email protected]
79-
if: always()
8080
with:
81-
name: test-results
82-
path: ./.coverage/*.trx
81+
name: build-verify-test-results
82+
path: |
83+
**/*.received.*
8384
8485
release:
8586
if: github.event_name == 'push'

.github/workflows/release.yml

+10-9
Original file line numberDiff line numberDiff line change
@@ -46,23 +46,16 @@ jobs:
4646

4747
- run: dotnet r build
4848

49-
- run: dotnet r test
49+
- run: dotnet r test -- --no-build --logger GitHubActions
5050

51-
- run: dotnet r pack
51+
- run: dotnet r pack -- --no-build
5252

5353
- name: Upload artifacts
5454
uses: actions/[email protected]
5555
with:
5656
name: nupkg
5757
path: ./artifacts/*.nupkg
5858

59-
- name: Upload test results
60-
uses: actions/[email protected]
61-
if: always()
62-
with:
63-
name: test-results
64-
path: ./.coverage/*.trx
65-
6659
- name: Upload release assets
6760
uses: softprops/action-gh-release@v1
6861
env:
@@ -82,3 +75,11 @@ jobs:
8275
dotnet nuget push "./artifacts/*.nupkg" \
8376
--api-key ${{ secrets.NUGET_TOKEN }} \
8477
--source https://api.nuget.org/v3/index.json
78+
79+
- name: Upload test results
80+
if: failure()
81+
uses: actions/[email protected]
82+
with:
83+
name: verify-test-results
84+
path: |
85+
**/*.received.*

.github/workflows/test-results.yml

-28
This file was deleted.

test/Tests.csproj

+4-4
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@
2727
</ItemGroup>
2828

2929
<ItemGroup>
30-
<PackageReference Include="coverlet.collector" Version="6.0.0">
31-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
32-
<PrivateAssets>all</PrivateAssets>
33-
</PackageReference>
3430
<PackageReference Include="FakeItEasy" Version="7.4.0" />
3531
<PackageReference Include="FakeItEasy.Analyzer.CSharp" Version="6.1.1">
3632
<PrivateAssets>all</PrivateAssets>
3733
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3834
</PackageReference>
35+
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.3">
36+
<PrivateAssets>all</PrivateAssets>
37+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
38+
</PackageReference>
3939
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.1" />
4040
<PackageReference Include="Shouldly" Version="4.2.1" />
4141
<PackageReference Include="System.IO.Abstractions.TestingHelpers" Version="19.2.69" />

0 commit comments

Comments
 (0)