-
-
Notifications
You must be signed in to change notification settings - Fork 16
61 lines (50 loc) · 1.38 KB
/
dotnet.yml
File metadata and controls
61 lines (50 loc) · 1.38 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
58
59
60
61
name: .NET CI
on:
push:
branches-ignore:
- 'dependabot/**'
- 'gh-pages'
tags-ignore:
- 'v*'
pull_request:
branches:
- 'main'
jobs:
build-and-test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
persist-credentials: false
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 8.0.x
- name: Setup GitVersion
uses: gittools/actions/gitversion/setup@v4
with:
versionSpec: '6.4.x'
- name: Execute GitVersion
id: gitversion
uses: gittools/actions/gitversion/execute@v4
- name: Cache NuGet packages
uses: actions/cache@v5
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/*.slnx') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Restore dependencies
run: dotnet restore
- name: Build Solution
run: |
echo "Version: ${{ steps.gitversion.outputs.fullSemVer }}"
echo "Assembly Version: ${{ steps.gitversion.outputs.assemblySemFileVer }}"
dotnet build --configuration Debug --no-restore
- name: Run Tests
run: dotnet test --configuration Debug --no-build --verbosity normal