Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
check-circle

GitHub Action

Coverlet coverage test

1.2.3

Coverlet coverage test

check-circle

Coverlet coverage test

Run coverlet coverage using a msbuild.rsp generated configuration

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Coverlet coverage test

uses: b3b00/[email protected]

Learn more about this action in b3b00/coverlet-action

Choose a version

Coverlet action

This action runs coverlet coverage tool on a dotnet core solution

⚠️ This action assumes that your unit test projects are correctly using coverlet packages.

Inputs

testProject

Required the path to the unit test csproj (relative to the repository root) e.g. `testProject/testProject.csproj

output

Required name of the coverage output file.

outputFormat

Required format of the output coverage file (lcov,cobertura, ...) see coverlet documentation : Coverage Output

excludes

assemblies and namespaces exclusions for coverage : see coverlet documentation Filters Filters must be separated with a ',' (comma). example : [filteredAssembly1]*,[filteredAssembl2]namespace2.*

threshold

Minimum coverage percent on all changes to your project below which build will fail. example : 80

Outputs

coverageFile

path to the generated coverage file. can be used to send data to coveralls for example.

Example usage

uses: b3b00/[email protected]
with:
  testProject: 'myProjectTests/myProjectTests.csproj'
  output: 'lcov.info'
  outputFormat: 'lcov'
  excludes: '[program]*,[test]test.*'
  threshold: 80

chaining coverlet with coveralls

- name : coverlet
uses: b3b00/[email protected]
with:
  testProject: 'myProjectTests/myProjectTests.csproj'
  output: 'lcov.info'
  outputFormat: 'lcov'
  excludes: '[program]*,[test]test.*'
- name: coveralls      
uses: coverallsapp/[email protected]
with:
  github-token: ${{secrets.GITHUB_TOKEN }} 
  path-to-lcov: ${{steps.coverlet.outputs.coverageFile}}