-
-
Notifications
You must be signed in to change notification settings - Fork 33
71 lines (66 loc) · 1.78 KB
/
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: test
on:
pull_request:
push:
branches:
- master
- develop
env:
HUSKY: 0
POSTGRES_USER: testing
POSTGRES_PASSWORD: verystrongpassword
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
project:
[
"DragaliaAPI.Test",
"DragaliaAPI.Integration.Test",
"DragaliaAPI.Database.Test",
"DragaliaAPI.Shared.Test",
"DragaliaAPI.Photon.StateManager.Test",
]
services:
postgres:
image: postgres
ports:
- "5432:5432"
env:
POSTGRES_USER: ${{ env.POSTGRES_USER }}
POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }}
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis/redis-stack
ports:
- "6379:6379"
options: >-
--health-cmd "redis-cli PING"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
- name: Setup .NET Core SDK 7
uses: actions/setup-dotnet@v3
with:
dotnet-version: "7.0.x"
- name: Install dependencies
run: dotnet restore ${{ matrix.project }}
- name: Test
run: >
dotnet test ${{ matrix.project }}
--no-restore
--logger "console;verbosity=detailed"
--logger "trx;LogFileName=${{ matrix.project }}.trx"
- name: Upload test report
uses: actions/upload-artifact@v3
if: success() || failure() # run this step even if previous step failed
with:
name: test-results
path: ${{ matrix.project }}/TestResults/${{ matrix.project }}.trx