-
Notifications
You must be signed in to change notification settings - Fork 309
59 lines (50 loc) · 1.49 KB
/
dotnet-unit-tests.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
54
55
56
57
58
59
name: Unit Tests
on:
workflow_dispatch:
pull_request:
branches:
- "main"
- "feature*"
- "dev"
paths:
- "**.cs"
- "**.csproj"
- "**.sln"
- "appsettings.json"
schedule:
- cron: "55 0 * * 0"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
dotnet-test:
name: Unit Tests
strategy:
fail-fast: false
max-parallel: 2
matrix:
include:
- { dotnet: "8.0.x", os: "ubuntu-latest" }
- { dotnet: "8.0.x", os: "windows-latest" }
runs-on: ${{ matrix.os }}
steps:
- name: Check out source
uses: actions/checkout@v4
- name: Setup .NET ${{ matrix.dotnet }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet }}
- name: Display .NET version
run: dotnet --version
- name: Build solution
run: dotnet build KernelMemory.sln -c Debug --nologo
- name: Run Unit Tests
run: dotnet test KernelMemory.sln -c Debug --filter Category=UnitTest -v q -l html --results-directory "TestResults-${{ matrix.os }}-${{ matrix.dotnet }}" --nologo --no-build
- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: dotnet-results-${{ matrix.os }}-${{ matrix.dotnet }}
path: TestResults-${{ matrix.os }}-${{ matrix.dotnet }}
if: ${{ always() }}