-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (32 loc) · 1.15 KB
/
build-test.yaml
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
name: Build and Test on Pull Request Creation
on:
pull_request:
branches:
- dev
env:
DOTNET_VERSION: "8.0.x"
CONFIGURATION: "Release"
jobs:
build-and-deploy:
#runs-on: windows-latest # For Linux, use ubuntu-latest, runs-on: self-hosted
runs-on: self-hosted
steps:
- name: "Checkout GitHub Action"
uses: actions/checkout@v4
- name: Cache NuGet packages
uses: actions/cache@v3
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Setup DotNet ${{ env.DOTNET_VERSION }} Environment
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Restore dependencies
run: dotnet restore Elevator-Management-Simulator.sln
- name: Build
run: dotnet build Elevator-Management-Simulator.sln --configuration ${{ env.CONFIGURATION }} --no-restore
- name: Run tests
run: dotnet test Elevator-Management-Simulator.sln --configuration ${{ env.CONFIGURATION }} --no-build --verbosity minimal