-
Notifications
You must be signed in to change notification settings - Fork 24
46 lines (37 loc) · 1.23 KB
/
test.yml
File metadata and controls
46 lines (37 loc) · 1.23 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
name: Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
name: .NET ${{ matrix.dotnet-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
dotnet-version: ["8.0", "9.0", "10.0"]
steps:
- uses: actions/checkout@v4
- name: Setup .NET ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore --configuration Release
- name: Run tests
run: dotnet test --no-build --configuration Release --verbosity normal
- name: Run tests with coverage
if: matrix.os == 'ubuntu-latest' && matrix.dotnet-version == '10.0'
run: |
dotnet test --configuration Release --collect:"XPlat Code Coverage" --results-directory ./coverage
- name: Upload coverage to Codecov
if: matrix.os == 'ubuntu-latest' && matrix.dotnet-version == '10.0'
uses: codecov/codecov-action@v4
with:
directory: ./coverage
fail_ci_if_error: false