-
Notifications
You must be signed in to change notification settings - Fork 246
80 lines (64 loc) · 2.11 KB
/
test-indicators.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
79
80
name: Indicators
on:
push:
branches: ["main","v3"]
pull_request:
types: [opened, synchronize, reopened]
jobs:
test:
name: unit tests
runs-on: ${{ matrix.os }}
permissions:
contents: read
actions: read
checks: write
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
dotnet-version: ["9.x"]
# TODO: restore when runners have 9.x on all
# ["2.1.x", "6.x", "9.x"]
env:
# identifying primary configuration so only one reports coverage
IS_PRIMARY: ${{ matrix.os == 'ubuntu-latest' && matrix.dotnet-version == '9.x' }}
# .NET SDK versions in the matrix that support `ga` quality spec
# versions before 5.x do not support it
SUPPORT_GA: ${{ contains(fromJson('["6.x", "9.x"]'), matrix.dotnet-version) }}
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet-version }}
dotnet-quality: "ga"
- name: Build library
run: >
dotnet build
--configuration Release
--property:ContinuousIntegrationBuild=true
-warnAsError
- name: Test indicators
run: >
dotnet test
--configuration Release
--settings tests/tests.unit.runsettings
--results-directory ./test-results
--no-build
--verbosity normal
--logger trx
--collect:"XPlat Code Coverage"
# the remaining steps are only needed from one primary instance
- name: Post test summary
uses: dorny/test-reporter@v1
if: env.IS_PRIMARY == 'true' && always()
with:
name: Test results
path: ./test-results/**/*.trx
reporter: dotnet-trx
- name: Publish coverage to Codacy
uses: codacy/codacy-coverage-reporter-action@v1
if: env.IS_PRIMARY == 'true'
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: ./test-results/**/coverage.cobertura.xml