-
-
Notifications
You must be signed in to change notification settings - Fork 400
90 lines (90 loc) · 2.98 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: .NET
on:
push:
pull_request:
merge_group:
permissions:
statuses: write
checks: write
contents: write
pull-requests: write
actions: write
jobs:
Build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x'
dotnet-quality: 'preview'
- name: Restore
run: dotnet restore
- name: Pack
run: dotnet pack -c Release
Test:
strategy:
fail-fast: false
matrix:
include:
- rid: win-x64
os: windows-latest
name: win-x64
- rid: linux-x64
os: ubuntu-20.04
name: linux-x64
- rid: osx-arm64
os: macos-latest
name: osx-arm64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x'
dotnet-quality: 'preview'
- name: Restore
run: dotnet restore --runtime ${{ matrix.rid }}
- name: Test
run: dotnet test -c Release --no-restore --runtime ${{ matrix.rid }} --collect:"XPlat Code Coverage" --results-directory ./coverage --logger:"trx"
- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: .NET Test Report (${{ matrix.rid }})
path: ./coverage/**/*.trx
reporter: dotnet-trx
- name: Upload Coverage Results
uses: actions/upload-artifact@v3
with:
name: coverage-${{ matrix.name }}
path: ./coverage/**/coverage.cobertura.xml
Report-Coverage:
runs-on: ubuntu-latest
needs: Test
permissions:
pull-requests: write
checks: write
steps:
- uses: actions/download-artifact@v3
with:
path: ./coverage
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.300
- name: Generate Report
uses: danielpalme/[email protected]
with:
reports: './coverage/**/**/coverage.cobertura.xml'
targetdir: './coveragereport'
reporttypes: 'Cobertura'
verbosity: 'Info'
tag: '${{ github.run_number }}_${{ github.run_id }}'
- uses: 5monkeys/cobertura-action@master
continue-on-error: true
with:
path: coveragereport/Cobertura.xml
minimum_coverage: 0