Skip to content

Commit 2690785

Browse files
authored
Add code coverage (#31)
1 parent c96dbf8 commit 2690785

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

.github/workflows/test.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,14 @@ jobs:
5858
run: dotnet build --no-restore -c Debug
5959
- name: Test solution [Debug]
6060
working-directory: src
61-
run: dotnet test --no-restore -p:CollectCoverage=true
61+
run: dotnet test --no-restore -p:CollectCoverage=true -p:CoverletOutputFormat=opencover -p:CoverletOutput=../.coverage/
6262
- name: Upload coverage to codecov
6363
if: ${{ startsWith(matrix.os, 'ubuntu') }}
6464
uses: codecov/codecov-action@v3
65+
env:
66+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
6567
with:
66-
files: .coverage/Destructurama.ByIgnoring.Tests/coverage.net8.opencover.xml
68+
files: src/.coverage/*.opencover.xml
6769

6870
buildcheck:
6971
needs:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
![License](https://img.shields.io/github/license/destructurama/json-net)
44

5-
[![codecov](https://codecov.io/gh/destructurama/json-net/branch/master/graph/badge.svg?token=0ZRHIUEQM4)](https://codecov.io/gh/destructurama/json-net)
5+
[![codecov](https://codecov.io/gh/destructurama/json-net/graph/badge.svg?token=abGh9D57gU)](https://codecov.io/gh/destructurama/json-net)
66
[![Nuget](https://img.shields.io/nuget/dt/Destructurama.JsonNet)](https://www.nuget.org/packages/Destructurama.JsonNet)
77
[![Nuget](https://img.shields.io/nuget/v/Destructurama.JsonNet)](https://www.nuget.org/packages/Destructurama.JsonNet)
88

src/Destructurama.JsonNet.Tests/Destructurama.JsonNet.Tests.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
1515
<PackageReference Include="Shouldly" Version="4.2.1" />
1616
<PackageReference Include="PublicApiGenerator" Version="11.1.0" />
17+
<PackageReference Include="coverlet.msbuild" Version="6.0.0">
18+
<PrivateAssets>all</PrivateAssets>
19+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
20+
</PackageReference>
1721
</ItemGroup>
1822

1923
<ItemGroup>

0 commit comments

Comments
 (0)