-
Notifications
You must be signed in to change notification settings - Fork 11
133 lines (122 loc) · 4.2 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: Tests
on:
pull_request:
push:
branches:
- main
concurrency:
group: test-${{ github.ref }}
cancel-in-progress: true
jobs:
csharp:
name: Test C#
strategy:
fail-fast: false
matrix:
dotnet:
- version: ''
framework: net4.7
- version: ''
framework: net4.8
- version: 6.0
framework: net6.0
- version: 8.0
framework: net8.0
platform:
- os: ubuntu-latest
runtime: linux-x64
- os: windows-2019
runtime: windows-x64
- os: windows-2022
runtime: windows-x64
handler:
- ''
- GrpcWebHandler
exclude:
- dotnet:
version: ''
platform:
os: ubuntu-latest
- dotnet:
version: 6.0
handler: GrpcWebHandler
- dotnet:
version: 8.0
handler: GrpcWebHandler
runs-on: ${{ matrix.platform.os }}
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
fetch-depth: 0
- name: Generate certs
working-directory: packages/csharp/
shell: bash
run: |
mkdir certs
cd certs
../../../scripts/certs.sh
- name: Install certs
if: ${{ matrix.platform.os == 'ubuntu-latest' }}
working-directory: packages/csharp/certs
run: |
sudo apt install ca-certificates
sudo mkdir -p /usr/local/share/ca-certificates/
sudo cp server2-ca.pem /usr/local/share/ca-certificates/ca.crt
sudo update-ca-certificates
- name: Install certs
if: ${{ contains(matrix.platform.os, 'windows') }}
working-directory: packages/csharp/certs
run: |
certutil -addstore -f "ROOT" server2-ca.pem
- name: Install .NET Core
uses: actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3 # v4
if: ${{ matrix.dotnet.version }} != ""
with:
dotnet-version: ${{ matrix.dotnet.version }}
- name: Build Mock server
working-directory: packages/csharp/ArmoniK.Api.Mock
shell: bash
run: |
dotnet publish -o ../out
[ -e ../out/ArmoniK.Api.Mock.exe ] || ln -s ArmoniK.Api.Mock ../out/ArmoniK.Api.Mock.exe
- name: Test
working-directory: packages/csharp/
shell: bash
env:
GrpcClient__HttpMessageHandler: ${{ matrix.handler }}
run: |
set +e
set -x
export CertFolder="$PWD/certs"
./out/ArmoniK.Api.Mock.exe \
grpc:port=5000 http:port=4999 \
& notls_pid=$!
./out/ArmoniK.Api.Mock.exe \
grpc:port=5001 http:port=5001 \
http:cert="$CertFolder/server1.pem" http:key="$CertFolder/server1.key" \
& tls_pid=$!
./out/ArmoniK.Api.Mock.exe \
grpc:port=5002 http:port=5002 \
http:cert="$CertFolder/server2.pem" http:key="$CertFolder/server2.key" \
& tlsstore_pid=$!
./out/ArmoniK.Api.Mock.exe \
grpc:port=5003 http:port=5003 \
http:cert="$CertFolder/server1.pem" http:key="$CertFolder/server1.key" http:clientcert="$CertFolder/client-ca.pem" \
& mtls_pid=$!
./out/ArmoniK.Api.Mock.exe \
grpc:port=5004 http:port=5004 \
http:cert="$CertFolder/server2.pem" http:key="$CertFolder/server2.key" http:clientcert="$CertFolder/client-ca.pem" \
& mtlsstore_pid=$!
sleep 5
cd ArmoniK.Api.Client.Test
dotnet test --runtime ${{ matrix.platform.runtime }} -f ${{ matrix.dotnet.framework }} --logger "trx;LogFileName=test-results.trx"; ret=$?
kill $notls_pid $tls_pid $tlsstore_pid $mtls_pid $mtlsstore_pid
exit $ret
- name: Test Report
uses: dorny/test-reporter@v1
if: always()
with:
name: ConnectivityTests ${{ matrix.platform.os }} ${{ matrix.dotnet.framework }} ${{ matrix.handler }}
path: ./packages/csharp/ArmoniK.Api.Client.Test/TestResults/test-results.trx
reporter: dotnet-trx