-
Notifications
You must be signed in to change notification settings - Fork 74
75 lines (61 loc) · 2.05 KB
/
CSharpTest.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
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@v2
with:
submodules: 'recursive'
- name: Setup .NET Core 3
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.202
- name: Setup .NET Core 5
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.202
- name: Setup .NET 7 # The dotnet CLI above is replaced by this but the runtime is kept
uses: actions/setup-dotnet@v1
with:
dotnet-version: '7.0.100'
include-prerelease: true
- 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@v2
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@v1
with:
file: ./Sources/Tests/UnitTests/coverage.opencover.xml