diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 000000000..fbdb45820 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,28 @@ +name: coverage + +on: + push: + branches: ["main"] + pull_request: + branches: ["main"] + +jobs: + coverage: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - name: Checkout + + uses: actions/checkout@v4 + - name: Build + uses: ./.github/actions/build + + - name: Generate Coverage Reports + run: dotnet test --collect:"XPlat Code Coverage" -p:RunSettingsFilePath=${{ github.workspace }}/build/Coverlet.runsettings + shell: bash + + - name: Coveralls + uses: coverallsapp/github-action@v2 + with: + files: tests/*/TestResults/*/coverage.cobertura.xml + format: cobertura diff --git a/README.md b/README.md index f7c4ed6bf..de81d3b40 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ [![CI](https://github.com/icerpc/icerpc-csharp/actions/workflows/ci.yml/badge.svg)][ci-home] [![License](https://img.shields.io/github/license/icerpc/icerpc-csharp?color=blue)][license] +[![Coverage Status](https://coveralls.io/repos/github/icerpc/icerpc-csharp/badge.svg?branch=main)](https://coveralls.io/github/icerpc/icerpc-csharp?branch=main) [Getting started] | [Examples] | [NuGet packages] | [Documentation] | [API reference] | [Building from source]