-
-
Notifications
You must be signed in to change notification settings - Fork 2
66 lines (55 loc) · 1.69 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Test
on:
push:
branches:
- main
pull_request:
jobs:
test_and_check_coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: "Setup Dotnet for use with actions"
uses: actions/setup-dotnet@v4
with:
global-json-file: 'global.json'
- name: "Restore tools"
run: dotnet tool restore
- name: "Run tests"
working-directory: commonItems.UnitTests
shell: pwsh
run: |
$env:CoverletOutput='./TestResults/coverage.info'
$env:CoverletOutputFormat='lcov'
dotnet test /p:CollectCoverage=true /p:IncludeTestAssembly=true /p:ExcludeByFile=**/Microsoft.NET.Test.Sdk.Program.cs /p:Exclude=[commonItems.UnitTests]*
- name: "Publish coverage report to coveralls.io"
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: commonItems.UnitTests/TestResults/coverage.info
test:
strategy:
matrix:
os: [[self-hosted, windows], macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: "Setup Dotnet for use with actions"
uses: actions/setup-dotnet@v4
with:
global-json-file: 'global.json'
- name: "Restore tools"
run: dotnet tool restore
- name: "Run tests"
working-directory: commonItems.UnitTests
run: |
# Prevent "Interop+AppleCrypto+SslException : bad protocol version" on macOS
if [ $RUNNER_OS = 'macOS' ]; then
dotnet dev-certs https
dotnet dev-certs https --trust
fi
dotnet test