-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (45 loc) · 1.33 KB
/
ci.yml
File metadata and controls
57 lines (45 loc) · 1.33 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
name: CI
on:
push:
branches: [ main, master, develop ]
pull_request:
branches: [ main, master ]
env:
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_NOLOGO: true
jobs:
build:
name: Build & Test
runs-on: windows-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET 8.0
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Cache NuGet packages
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/Directory.Build.props') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore -warnaserror
- name: Check formatting
run: dotnet format --verify-no-changes --no-restore
- name: Run tests with coverage
run: dotnet test --no-build --collect:"XPlat Code Coverage" --results-directory:./TestResults/
- name: Upload coverage reports
uses: actions/upload-artifact@v4
with:
name: coverage-reports
path: ./TestResults/
retention-days: 14
- name: Audit NuGet packages
run: dotnet nuget audit