-
Notifications
You must be signed in to change notification settings - Fork 121
51 lines (39 loc) · 1.4 KB
/
build.yml
File metadata and controls
51 lines (39 loc) · 1.4 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
name: Build
on:
push:
pull_request:
permissions:
contents: read
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
env:
# Set the build number in MinVer.
MINVERBUILDMETADATA: build.${{github.run_number}}
steps:
- name: Harden Runner
uses: step-security/harden-runner@58077d3c7e43986b6b15fba718e8ea69e387dfcc # v2.15.1
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0
- name: Restore packages
run: dotnet restore
- name: Build
run: dotnet build --no-restore --configuration Debug
- name: Run tests
# The '--' separator forwards options to the Microsoft Testing Platform runner.
# After upgrading to .NET 10 SDK, these can be passed directly without '--'.
run: dotnet test --no-build --configuration Debug -- --coverage --coverage-output-format cobertura
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}