-
Notifications
You must be signed in to change notification settings - Fork 1
52 lines (42 loc) · 1.5 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: CI
on:
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore -c Release
- name: Test
continue-on-error: true
run: dotnet test --no-build -c Release --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=cobertura
- name: ReportGenerator
uses: im-open/code-coverage-report-generator@4
with:
reports: '*/**/coverage.cobertura.xml'
targetdir: './coverage-results'
title: dotnet code coverage
reporttypes: 'MarkdownSummary;'
- name: Create a status check for the code coverage results
id: dotnet-coverage-check
uses: im-open/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
summary-file: './coverage-results/Summary.md'
#create-status-check: true
create-pr-comment: true
update-comment-if-one-exists: true
update-comment-key: 'dotnet'
ignore-threshold-failures: false
line-threshold: 80
branch-threshold: 80