-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (75 loc) · 2.46 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: 'Run all tests'
## Only runs when someone pushes to main or PRs against main or develop
on:
push:
branches:
- develop
- bugfix/*
- feature/*
paths-ignore:
- '**/*.md'
pull_request:
branches:
- main
- develop
- bugfix/*
- feature/*
paths-ignore:
- '**/*.md'
workflow_dispatch:
env:
DOTNET_NOLOGO: true # Disable the .NET logo
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true # Disable the .NET first time experience
DOTNET_CLI_TELEMETRY_OPTOUT: true # Disable sending .NET CLI telemetry
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install the .NET SDK
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'
include-prerelease: false
- name: Install code level dependencies
run: dotnet restore
#substitute production appsettings entries to appsettings json file
- name: App Settings Variable Substitution
uses: microsoft/variable-substitution@v1
with:
files: '**/appsettings.json'
env:
ConnectionStrings.invoiceConnectionString: ${{ secrets.CONNECTION_STRING }}
- name: Build
run: dotnet build --no-restore --configuration Release
- name: Run tests
run: dotnet test --configuration Release --no-build --collect:"XPlat Code Coverage" --results-directory ./coverage
- name: ReportGenerator
uses: danielpalme/[email protected]
with:
reports: '**/*.cobertura.xml'
targetdir: 'coveragereport'
reporttypes: 'HtmlInline;Cobertura'
verbosity: 'Info' # The verbosity level of the log messages. Values: Verbose, Info, Warning, Error, Off
toolpath: 'reportgeneratortool' # Default directory for installing the dotnet tool.
- name: Code Coverage Summary Report
uses: irongut/[email protected]
with:
filename: coveragereport/Cobertura.xml
badge: true
fail_below_min: true
format: markdown
hide_branch_rate: false
hide_complexity: true
indicators: true
output: both
thresholds: '50 75'
- name: Add Coverage PR Comment
uses: marocchino/sticky-pull-request-comment@v2
if: github.event_name == 'pull_request'
with:
recreate: true
path: code-coverage-results.md