-
Notifications
You must be signed in to change notification settings - Fork 2
55 lines (45 loc) · 1.27 KB
/
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
name: Run Unit Tests
on:
push:
branches: [ "master" ]
paths:
- '**.cs'
- '**.csproj'
pull_request:
branches: [ "master" ]
paths:
- '**.cs'
- '**.csproj'
workflow_dispatch:
jobs:
run-unit-tests:
strategy:
matrix:
os: [ ubuntu-latest, windows-latest ]
dotnet-version: [ '9.0.x' ]
permissions:
packages: write
contents: read
env:
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repository
uses: actions/[email protected]
- name: Setup .NET ${{ matrix.dotnet-version }}
uses: actions/[email protected]
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Check Dependency Cache
uses: actions/[email protected]
with:
path: ${{ github.workspace }}/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Install Dependencies
run: dotnet restore
- name: Build Tests
run: dotnet build --configuration Release --no-restore
- name: Run Tests
run: dotnet test --no-restore --verbosity normal