-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (40 loc) · 1.16 KB
/
build-and-test-backend.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
name: Build and test - backend
on:
push:
paths:
- "**.cs"
- "**.csproj"
pull_request:
branches: [master]
paths:
- "**.cs"
- "**.csproj"
env:
DOTNET_VERSION: "7.0" # The .NET SDK version to use
jobs:
build-and-test-backend:
name: build-and-test-${{matrix.os}}
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v3
- name: Setup .NET Core ${{ env.DOTNET_VERSION }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Install dependencies
working-directory: ./backend
run: dotnet restore
- name: Check licenses
working-directory: ./backend
run: |
dotnet tool install --global dotnet-project-licenses --version 2.7.1
dotnet-project-licenses -i src --allowed-license-types allowed-licenses.json
- name: Build
working-directory: ./backend
run: dotnet build --configuration Release --no-restore
- name: Test
working-directory: ./backend
run: dotnet test --no-restore --verbosity normal