Skip to content

Commit 8361c1d

Browse files
committed
ci: add build-and-test GitHub action
Signed-off-by: Kenny Pflug <[email protected]>
1 parent 22587d7 commit 8361c1d

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: 'Cache NuGet Packages'
2+
description: 'Sets up caching for NuGet packages to speed up builds'
3+
author: 'Kenny Pflug'
4+
5+
runs:
6+
using: 'composite'
7+
steps:
8+
- name: Cache NuGet packages
9+
uses: actions/cache@v4
10+
with:
11+
path: ~/.nuget/packages
12+
key: nuget-${{ runner.os }}-${{ hashFiles('**/packages.lock.json') }}
13+
restore-keys: |
14+
nuget-${{ runner.os }}-
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Build and Test
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build-and-test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
- name: Set up .NET
16+
uses: actions/setup-dotnet@v4
17+
with:
18+
global-json-file: ./global.json
19+
- name: Cache NuGet packages
20+
uses: ./.github/actions/cache-nuget
21+
- name: Restore dependencies
22+
run: dotnet restore ./Light.ExtendedPath.slnx /p:ContinuousIntegrationBuild=true
23+
- name: Build
24+
run: dotnet build ./Light.ExtendedPath.slnx --configuration Release --no-restore /p:ContinuousIntegrationBuild=true
25+
- name: Test
26+
run: dotnet test ./Light.ExtendedPath.slnx --configuration Release --no-build --verbosity normal

0 commit comments

Comments
 (0)