Skip to content

Commit af8c507

Browse files
committed
Added coverage reports.
1 parent 1dea224 commit af8c507

File tree

3 files changed

+13
-21
lines changed

3 files changed

+13
-21
lines changed

.github/workflows/dotnetcore.yml

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,7 @@ jobs:
2323
pwsh -file release.ps1 Release
2424
- name: Test
2525
shell: bash
26-
run: dotnet test Tests/CSharpCore/Tests.NetStandard.csproj --configuration Release --no-build --logger trx --collect "Code coverage" --results-directory ./TestResults
27-
- name: Test Results
28-
uses: NasAmin/[email protected]
29-
id: trx-parser
30-
with:
31-
TRX_PATH: ${{ github.workspace }}/TestResults #This should be the path to your TRX files
32-
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
run: dotnet test Tests/CSharpCore/Tests.NetStandard.csproj --configuration Release --no-build /p:CollectCoverage=true /p:CoverletOutput=TestResults/ /p:CoverletOutputFormat=lcov -- RunConfiguration.DisableAppDomain=true
3327

3428
linux:
3529
runs-on: ubuntu-latest
@@ -51,13 +45,7 @@ jobs:
5145
pwsh -file release.ps1 Release
5246
- name: Test
5347
shell: bash
54-
run: dotnet test Tests/CSharpCore/Tests.NetStandard.csproj --configuration Release --no-build --logger trx --collect "Code coverage" --results-directory ./TestResults
55-
- name: Test Results
56-
uses: NasAmin/[email protected]
57-
id: trx-parser
58-
with:
59-
TRX_PATH: ${{ github.workspace }}/TestResults #This should be the path to your TRX files
60-
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
run: dotnet test Tests/CSharpCore/Tests.NetStandard.csproj --configuration Release --no-build /p:CollectCoverage=true /p:CoverletOutput=TestResults/ /p:CoverletOutputFormat=lcov -- RunConfiguration.DisableAppDomain=true
6149

6250
windows:
6351

@@ -77,10 +65,9 @@ jobs:
7765
run: build.release.bat
7866
- name: Test
7967
shell: cmd
80-
run: dotnet test Tests/CSharpCore/Tests.NetStandard.csproj --configuration Release --no-build --logger trx --collect "Code coverage" --results-directory ./TestResults
81-
- name: Test Results
82-
uses: NasAmin/[email protected]
83-
id: trx-parser
68+
run: dotnet test Tests/CSharpCore/Tests.NetStandard.csproj --configuration Release --no-build /p:CollectCoverage=true /p:CoverletOutput=TestResults/ /p:CoverletOutputFormat=lcov -- RunConfiguration.DisableAppDomain=true
69+
- name: Publish coverage report to coveralls.io
70+
uses: coverallsapp/github-action@master
8471
with:
85-
TRX_PATH: ${{ github.workspace }}/TestResults #This should be the path to your TRX files
86-
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
72+
github-token: ${{ secrets.GITHUB_TOKEN }}
73+
path-to-lcov: ${{ github.workspace }}\Tests\CSharpCore\TestResults\coverage.net6.0.info

Tests/CSharpCore/Tests.NetStandard.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727
<None Include="sharpsnmplib.tests.snk" />
2828
</ItemGroup>
2929
<ItemGroup>
30+
<PackageReference Include="coverlet.msbuild" Version="3.1.0">
31+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
32+
<PrivateAssets>all</PrivateAssets>
33+
</PackageReference>
3034
<PackageReference Include="xunit" Version="2.4.1" />
3135
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
3236
<PrivateAssets>all</PrivateAssets>

readme.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
=============
33
[![Join the chat at https://gitter.im/sharpsnmplib](https://img.shields.io/gitter/room/sharpsnmplib/Lobby.svg?style=flat-square)](https://gitter.im/sharpsnmplib/Lobby?utm_source=share-link&utm_medium=link&utm_campaign=share-link)
44
[![NuGet Version](https://img.shields.io/nuget/v/Lextm.SharpSnmpLib.svg?style=flat-square)](https://www.nuget.org/packages/Lextm.SharpSnmpLib/)
5-
[![Azure DevOps builds](https://img.shields.io/azure-devops/build/lextudio/08d27f27-71b2-4158-90ec-565c685b3c05/5.svg?style=flat-square)](https://dev.azure.com/lextudio/sharpsnmp/_build/)
5+
[![Build](https://img.shields.io/github/workflow/status/lextudio/sharpsnmplib/.NET%20Core?style=flat-square)](https://github.com/lextudio/sharpsnmplib/actions/workflows/dotnetcore.yml)
6+
[![Coverage](https://img.shields.io/coveralls/github/lextudio/sharpsnmplib?style=flat-square)](https://coveralls.io/github/lextudio/sharpsnmplib)
67

78
This is the source code repository of #SNMP Library. Visual Studio 2019 and .NET Core SDK (for .NET Core 2.1 and above) is required to compile it on Windows.
89

0 commit comments

Comments
 (0)