-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (55 loc) · 1.62 KB
/
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
54
55
56
57
58
59
60
61
62
name: Testing
on:
pull_request:
branches:
- "**"
workflow_dispatch:
concurrency:
group: testing-${{ github.ref }}
cancel-in-progress: true
jobs:
lint_api:
name: Lint API
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
- name: Linting
run: dotnet format --verify-no-changes
test_api:
name: Test API
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_USER: user
POSTGRES_PASSWORD: pass
POSTGRES_DB: test
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
- name: Tools
run: dotnet tool restore
- name: Tests
run: dotnet test --blame-hang-timeout 1m --configuration Release --collect:"XPlat Code Coverage" --results-directory ./artifacts
- uses: actions/upload-artifact@v4
name: Upload Blame Dump
if: failure()
with:
name: blame-dump
path: artifacts/**/dotnet_*.dmp
if-no-files-found: ignore
- name: Generate Coverage Report
run: dotnet reportgenerator -reports:artifacts/**/*.xml -targetdir:coveragereport -reporttypes:MarkdownSummaryGithub
- name: Report Summary
run: cat coveragereport/SummaryGithub.md >> $GITHUB_STEP_SUMMARY