-
-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (69 loc) · 2.03 KB
/
dotnet.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
# 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: .NET
permissions:
checks: write
pull-requests: write
on:
push:
branches: [ "main" ]
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: |
9.0.x
- name: Cache nuget packages
id: cache-nuget
uses: actions/cache@v4
with:
path: |
~/.nuget/packages
**/obj/*
key: ${{ runner.os }}-nuget_obj-${{ hashFiles('**/*.csproj', 'global.json', 'Directory.Build.props') }}
- name: Restore dependencies
if: steps.cache-nuget.outputs.cache-hit != 'true'
run: dotnet restore
- name: Check code formatting
run: dotnet format --no-restore --verify-no-changes -v diag
- name: Build
run: dotnet build
--no-restore
--configuration Release
- name: Test
working-directory: Tests/CleanAspCore.Api.Tests
run: >
dotnet run
--no-build
--configuration Release
--coverage
--coverage-output-format cobertura
--report-trx
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: |
**/*.trx
- name: Code Coverage Report
uses: irongut/[email protected]
with:
filename: "**/*.cobertura.xml"
badge: true
format: markdown
hide_branch_rate: false
hide_complexity: true
indicators: true
output: both
- 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