Skip to content

Commit 8a6e98f

Browse files
committed
coverage
1 parent e8261cc commit 8a6e98f

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

.github/workflows/ci.yml

+5
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,8 @@ jobs:
3939
shell: pwsh
4040
run: |
4141
./Build.ps1
42+
- name: Upload coverage to codecov
43+
uses: codecov/codecov-action@v4
44+
with:
45+
token: ${{ secrets.CODECOV_TOKEN }}
46+
files: .coverage/*.opencover.xml

Build.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ try {
5252

5353
Write-Output "build: Testing project in $test"
5454

55-
& dotnet test -c Release --no-build --no-restore
55+
& dotnet test -c Release --no-build --no-restore -p:CollectCoverage=true -p:CoverletOutputFormat=opencover -p:CoverletOutput=.coverage/
5656
if ($LASTEXITCODE -ne 0) { throw "Testing failed" }
5757

5858
Pop-Location

test/Serilog.Settings.Configuration.Tests/Serilog.Settings.Configuration.Tests.csproj

+4
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@
3030
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2" />
3131
<PackageReference Include="Shouldly" Version="4.2.1" />
3232
<PackageReference Include="PublicApiGenerator" Version="11.1.0" />
33+
<PackageReference Include="coverlet.msbuild" Version="6.0.2">
34+
<PrivateAssets>all</PrivateAssets>
35+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
36+
</PackageReference>
3337
</ItemGroup>
3438

3539
<ItemGroup>

0 commit comments

Comments
 (0)