-
Notifications
You must be signed in to change notification settings - Fork 78
64 lines (53 loc) · 1.76 KB
/
CSharpTest.yml
File metadata and controls
64 lines (53 loc) · 1.76 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
name: 'C# Test'
on:
push:
branches:
- master
pull_request:
branches:
- '*'
jobs:
Test:
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
with:
submodules: 'recursive'
- name: Setup .NET 10
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.x'
dotnet-quality: 'preview'
- name: Build Tests # We need it to be able to retry
run: |
dotnet add "Sources/Tests/UnitTests" package GitHubActionsTestLogger
dotnet build Sources/Tests/UnitTests
- name: Test if not to send
if: ${{ matrix.os != 'windows-latest' }}
run: |
dotnet test "Sources/Tests/UnitTests" -c Release -l GitHubActions /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
- name: Test if to send
if: ${{ matrix.os == 'windows-latest' }}
run: |
cd Sources/Tests/UnitTests
dotnet test --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover
cd ../../Utils/Utils
dotnet run CopyCovReport
- name: Info about the coverage report
if: ${{ matrix.os == 'windows-latest' }}
run: dir ./Sources/Tests/UnitTests/coverage.opencover.xml
- name: 'Upload report as artifact'
if: ${{ matrix.os == 'windows-latest' }}
uses: actions/upload-artifact@v6
with:
name: Report
path: ./Sources/Tests/UnitTests/coverage.opencover.xml
retention-days: 3
- name: 'Send to codecov'
if: ${{ matrix.os == 'windows-latest' }}
uses: codecov/codecov-action@v5
with:
file: ./Sources/Tests/UnitTests/coverage.opencover.xml