This repository was archived by the owner on May 31, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChrison.Extensions-Unit-Test.yml
More file actions
59 lines (48 loc) · 1.61 KB
/
Copy pathChrison.Extensions-Unit-Test.yml
File metadata and controls
59 lines (48 loc) · 1.61 KB
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
53
54
55
56
57
58
59
name: Code Coverage Chrison.Extensions
on:
push:
paths: ['Chrison.Extensions/**','Chrison.Extensions.Tests/**']
pull_request:
paths: ['Chrison.Extensions/**','Chrison.Extensions.Tests/**']
workflow_dispatch:
env:
NET_VERSION: '9.x'
RELEASE_CONFIG: Release
PROJECT_NAME: Chrison.Extensions.Tests
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup .NET SDK ${{ env.NET_VERSION }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.NET_VERSION }}
dotnet-quality: 'ga'
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Run tests with coverage
run: dotnet test ${{env.PROJECT_NAME}}/${{env.PROJECT_NAME}}.csproj --no-build --collect:"XPlat Code Coverage" #-p:CollectCoverage=true -p:CoverletOutputFormat=opencover
continue-on-error: true
- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: '**/${{env.PROJECT_NAME}}/TestResults/**/coverage.cobertura.xml'
- name: Code Coverage Report
uses: irongut/CodeCoverageSummary@v1.3.0
with:
filename: '**/${{env.PROJECT_NAME}}/TestResults/**/coverage.cobertura.xml'
badge: true
fail_below_min: true
format: markdown
hide_branch_rate: false
hide_complexity: true
indicators: true
output: both
thresholds: '60 80'
- name: Write to Job Summary
run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY