Skip to content

Commit

Permalink
Added coverage reports.
Browse files Browse the repository at this point in the history
  • Loading branch information
lextm committed Dec 17, 2021
1 parent 1dea224 commit af8c507
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 21 deletions.
27 changes: 7 additions & 20 deletions .github/workflows/dotnetcore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,7 @@ jobs:
pwsh -file release.ps1 Release
- name: Test
shell: bash
run: dotnet test Tests/CSharpCore/Tests.NetStandard.csproj --configuration Release --no-build --logger trx --collect "Code coverage" --results-directory ./TestResults
- name: Test Results
uses: NasAmin/[email protected]
id: trx-parser
with:
TRX_PATH: ${{ github.workspace }}/TestResults #This should be the path to your TRX files
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: dotnet test Tests/CSharpCore/Tests.NetStandard.csproj --configuration Release --no-build /p:CollectCoverage=true /p:CoverletOutput=TestResults/ /p:CoverletOutputFormat=lcov -- RunConfiguration.DisableAppDomain=true

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

windows:

Expand All @@ -77,10 +65,9 @@ jobs:
run: build.release.bat
- name: Test
shell: cmd
run: dotnet test Tests/CSharpCore/Tests.NetStandard.csproj --configuration Release --no-build --logger trx --collect "Code coverage" --results-directory ./TestResults
- name: Test Results
uses: NasAmin/[email protected]
id: trx-parser
run: dotnet test Tests/CSharpCore/Tests.NetStandard.csproj --configuration Release --no-build /p:CollectCoverage=true /p:CoverletOutput=TestResults/ /p:CoverletOutputFormat=lcov -- RunConfiguration.DisableAppDomain=true
- name: Publish coverage report to coveralls.io
uses: coverallsapp/github-action@master
with:
TRX_PATH: ${{ github.workspace }}/TestResults #This should be the path to your TRX files
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ${{ github.workspace }}\Tests\CSharpCore\TestResults\coverage.net6.0.info
4 changes: 4 additions & 0 deletions Tests/CSharpCore/Tests.NetStandard.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
<None Include="sharpsnmplib.tests.snk" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="3.1.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
<PrivateAssets>all</PrivateAssets>
Expand Down
3 changes: 2 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
=============
[![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)
[![NuGet Version](https://img.shields.io/nuget/v/Lextm.SharpSnmpLib.svg?style=flat-square)](https://www.nuget.org/packages/Lextm.SharpSnmpLib/)
[![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/)
[![Build](https://img.shields.io/github/workflow/status/lextudio/sharpsnmplib/.NET%20Core?style=flat-square)](https://github.com/lextudio/sharpsnmplib/actions/workflows/dotnetcore.yml)
[![Coverage](https://img.shields.io/coveralls/github/lextudio/sharpsnmplib?style=flat-square)](https://coveralls.io/github/lextudio/sharpsnmplib)

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.

Expand Down

0 comments on commit af8c507

Please sign in to comment.