-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (37 loc) · 1.12 KB
/
test.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
name: "Run tests"
on:
push:
branches: [main]
pull_request:
jobs:
test:
runs-on: ubuntu-latest
name: Run tests (${{ matrix.dotnet-version }})
env:
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
strategy:
matrix:
dotnet-version: ["6.0.x", "8.0.x"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: "${{ matrix.dotnet-version }}"
- run: dotnet restore
- name: Run tests with coverage
run: >
dotnet test
--no-restore
--collect:"XPlat Code Coverage"
/p:CoverletOutputFormat=cobertura
--logger trx
--results-directory "test-results"
--
# Exclude the generated files from the code coverage report.
DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.ExcludeByFile="**/*.g.cs"
- name: Upload coverage to Codeclimate
uses: paambaati/codeclimate-action@v5
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageLocations: "test-results/**/coverage.cobertura.xml:cobertura"