-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (65 loc) · 2.04 KB
/
unit-tests.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: unit tests
on: [push]
env:
DOTNET_MINIMUM_TEST_COVERAGE: 0
jobs:
dotnet-tests:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: Server/ReasnAPI
steps:
- uses: actions/checkout@v4
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Install coverlet
run: dotnet tool install -g coverlet.console
- name: Install dependencies
run: dotnet restore
- name: Build solution
run: dotnet build --no-restore
- name: Test with dotnet
run: >
dotnet test
--no-build
--verbosity normal
--logger "trx;logfilename=${{ matrix.os }}-commit-${{ github.sha }}.trx"
--results-directory "TestResults-${{ matrix.os }}-commit-${{ github.sha }}"
- name: Run coverlet
run: >
coverlet .
--target "dotnet"
--targetargs "test --no-build"
--threshold ${{ env.DOTNET_MINIMUM_TEST_COVERAGE }}
- name: Upload dotnet test results
uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: dotnet-results-${{ matrix.os }}-commit-${{ github.sha }}
path: Server/ReasnAPI/TestResults-${{ matrix.os }}-commit-${{ github.sha }}
retention-days: 14
client-tests:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: Client/reasn-client
steps:
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: '21.7.x'
- name: Set yarn version
run: yarn set version 4.1
- name: Install dependencies
run: yarn install --immutable
- name: Test with jest
run: yarn test --coverage --ci