-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (63 loc) · 1.89 KB
/
dotnet-tests.yml
File metadata and controls
75 lines (63 loc) · 1.89 KB
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
name: .NET Tests (collector)
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+' # v1.2.3
# on:
# push:
# branches: ["master" ]
# paths-ignore:
# - "**/*.md"
# - "**/*.png"
# - "**/*.jpg"
# - "**/*.svg"
#pull_request:
#branches: [ "main", "master" ]
#workflow_dispatch: {}
jobs:
test:
runs-on: ubuntu-latest
permissions:
id-token: write # for Codecov OIDC (safe to keep)
strategy:
matrix:
include:
- name: UserManagementApi.Tests.Unit
proj: UserManagementApi.Tests.Unit/UserManagementApi.Tests.Unit.csproj
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: Sanity - show files at repo root
run: ls -la
- name: Restore
run: dotnet restore
- name: Build (Release)
run: dotnet build --configuration Release --no-restore
- name: Test with coverage (collector → LCOV)
run: |
dotnet test "${{ matrix.proj }}" \
--configuration Release \
--no-build \
--collect:"XPlat Code Coverage" \
--settings coverlet.runsettings \
--results-directory "./TestResults/${{ matrix.name }}" \
--logger "trx;LogFileName=${{ matrix.name }}.trx" \
-v n
- name: Upload coverage + TRX
if: always()
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.name }}-results
path: |
TestResults/${{ matrix.name }}/**/coverage.info
TestResults/${{ matrix.name }}/**/*.trx
- name: Upload to Codecov
if: success()
uses: codecov/codecov-action@v5
with:
files: TestResults/${{ matrix.name }}/**/coverage.info
flags: ${{ matrix.name }}
fail_ci_if_error: true
use_oidc: true