-
Notifications
You must be signed in to change notification settings - Fork 16
31 lines (31 loc) · 1.08 KB
/
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
name: backend-test
on:
workflow_dispatch:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
backend-test:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup dotnet 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0'
- name: Restore NuGet packages
run: dotnet restore
- name: Restore tools
run: dotnet tool restore
- name: Backup committed openapi.json
run: cp LeaderboardBackend/openapi.json /tmp/committed-openapi.json
- name: Build
run: dotnet build --no-restore
- name: Verify that committed openapi.json is up-to-date
run: |
diff --brief LeaderboardBackend/openapi.json /tmp/committed-openapi.json \
|| (echo "LeaderboardBackend/openapi.json is outdated. Please build the project and commit the auto-generated file."; exit 1)
- name: Run tests
run: dotnet test LeaderboardBackend.Test --no-restore