-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (50 loc) · 1.63 KB
/
dotnet.yml
File metadata and controls
53 lines (50 loc) · 1.63 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
name: Build and Test with Coverage
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.1.7
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v4.0.1
with:
dotnet-version: 8.0.x
- name: Restore NuGet packages
run: dotnet restore
- name: Build
run: dotnet build --configuration Release
test-and-coverage:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.1.7
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v4.0.1
with:
dotnet-version: 8.0.x
- name: Test
run: dotnet test --configuration Release --collect:"XPlat Code Coverage" --settings coverlet.runsettings
- name: Install ReportGenerator
run: dotnet tool install --global dotnet-reportgenerator-globaltool --version 5.3.9
- name: Generate coverage report
run: reportgenerator -reports:'**/coverage.cobertura.xml' "-targetdir:TestResults/CoverageReport" "-reporttypes:Html;Lcov;"
- name: Coveralls GitHub Action
uses: coverallsapp/github-action@v2.3.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./TestResults/CoverageReport/lcov.info
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.PTA }}
publish_dir: ./TestResults/CoverageReport
publish_branch: gh-pages
commit_message: "Update code coverage report"