-
Notifications
You must be signed in to change notification settings - Fork 4
54 lines (42 loc) · 1.37 KB
/
build-test.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
name: .NET Core Desktop Build and Test
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
workflow_dispatch:
jobs:
build:
name: Build and Test
runs-on: windows-latest # For a list of available runner types, refer to
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on
env:
Solution_Name: BudgetAnalyser.sln
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cache .NET packages
uses: actions/cache@v3
with:
path: |
~/.nuget/packages
~/.local/share/NuGet/Cache
key: ${{ runner.os }}-nuget-${{ hashFiles('**/obj/project.assets.json') }}
restore-keys: |
${{ runner.os }}-nuget-
# Install the .NET Core workload
- name: Install .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore --verbosity quiet --configuration Debug
# Execute all unit tests in the solution
- name: Run unit tests
run: dotnet test --no-build --verbosity minimal --configuration Debug
- name: Validate code style
run: dotnet format --no-restore --verify-no-changes --verbosity minimal