.NET coverage (#20) #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: .NET - coverlet test coverage | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: | |
- main | |
- 'releases/*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
fetch-depth: 0 | |
- name: Set up .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '7.0' | |
- name: Add coverlet dependencies | |
working-directory: NET/coverlet/UnitTestProject | |
run: | | |
dotnet add package coverlet.msbuild; dotnet add package coverlet.collector | |
- name: Build solution | |
working-directory: NET/coverlet | |
run: dotnet build | |
- name: Run tests with code coverage | |
run: dotnet test /p:CollectCoverage=true /p:CoverletOutput=../.qodana/code-coverage/ /p:CoverletOutputFormat=lcov | |
working-directory: NET/coverlet | |
- name: Archive coverage data | |
uses: actions/upload-artifact@v2 | |
with: | |
name: net-coverage-data | |
path: NET/coverlet/.qodana/code-coverage | |
- name: Qodana Scan | |
uses: JetBrains/qodana-action@main | |
env: | |
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN_NET }} | |
with: | |
args: "-i,NET/coverlet,--linter,jetbrains/qodana-dotnet:latest" | |
pr-mode: false |