-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (47 loc) · 1.45 KB
/
build-test.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
name: Build branch
on:
push:
branches: [ master, feature/* ]
pull_request:
branches: [ master, develop ]
jobs:
Build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.101
- name: Install dependencies
run: dotnet tool restore
- name: Build
run: |
$GitVersion = (dotnet tool run dotnet-gitversion /output json /verbosity verbose) | ConvertFrom-Json
dotnet build --configuration Release -p:VersionPrefix=$($GitVersion.NuGetVersion)
shell: pwsh
Test:
runs-on: windows-latest
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.101
- name: Test
run: dotnet test --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura
- run: |
dotnet tool install -g dotnet-reportgenerator-globaltool
reportgenerator -reports:**/coverage.cobertura.xml -targetdir:CodeCoverage -reporttypes:Cobertura
name: Create Code coverage report
- uses: 5monkeys/cobertura-action@master
name: 'Publish code coverage'
with:
path: CodeCoverage/Cobertura.xml
repo_token: ${{ secrets.GITHUB_TOKEN }}
minimum_coverage: 50