-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (50 loc) · 1.55 KB
/
Copy pathci-build-test.yml
File metadata and controls
61 lines (50 loc) · 1.55 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
60
61
name: CI Build and Test
on:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x
- name: Restore
run: dotnet restore HubDocs.sln
- name: Build
run: dotnet build HubDocs.sln -c Release --no-restore
- name: Run unit tests
run: dotnet test tests/HubDocs.UnitTests/HubDocs.UnitTests.csproj -c Release --no-build --collect:"XPlat Code Coverage"
- name: Install ReportGenerator
if: always()
run: |
dotnet tool install --global dotnet-reportgenerator-globaltool
echo "$HOME/.dotnet/tools" >> "$GITHUB_PATH"
- name: Generate HTML coverage report
if: always()
run: |
reportgenerator \
-reports:"tests/HubDocs.UnitTests/TestResults/**/coverage.cobertura.xml" \
-targetdir:"coverage-report" \
-reporttypes:"Html;MarkdownSummary"
- name: Upload coverage artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: test-coverage-cobertura
path: tests/HubDocs.UnitTests/TestResults/**/coverage.cobertura.xml
- name: Upload HTML coverage report
if: always()
uses: actions/upload-artifact@v4
with:
name: test-coverage-html
path: coverage-report