-
-
Notifications
You must be signed in to change notification settings - Fork 6
46 lines (38 loc) · 1.06 KB
/
build.yml
File metadata and controls
46 lines (38 loc) · 1.06 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
name: Build
on:
pull_request:
branches:
- "main"
workflow_dispatch:
workflow_call:
jobs:
build:
name: Build & Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
6.0.x
8.0.x
10.0.x
- name: Build
run: dotnet build -c Release
- name: Run tests without Coverage
if: startsWith(matrix.os, 'windows')
run: dotnet test --no-build -c Release -p:CollectCoverage=false
- name: Run tests with Coverage
if: startsWith(matrix.os, 'ubuntu')
run: dotnet test --no-build -c Release -p:CollectCoverage=true -e:CoverletOutputFormat=opencover
- name: Publish to Codecov
if: startsWith(matrix.os, 'ubuntu')
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}