-
Notifications
You must be signed in to change notification settings - Fork 55
226 lines (191 loc) · 6.81 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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
name: Test
on:
pull_request: {}
push:
branches:
- main
jobs:
linux_test:
name: Linux
strategy:
fail-fast: false
matrix:
config:
- branch: 'v2.9'
- branch: 'latest'
- branch: 'main'
runs-on: ubuntu-latest
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
NUGET_XMLDOC_MODE: skip
steps:
- name: Install nats-server
run: |
branch=$(curl https://api.mtmk.dev/gh/v1/releases/tag/nats-io/nats-server/${{ matrix.config.branch }})
for i in 1 2 3
do
curl -sf https://binaries.nats.dev/nats-io/nats-server/v2@$branch | PREFIX=. sh && break || sleep 30
done
sudo mv nats-server /usr/local/bin
- name: Check nats-server
run: nats-server -v
- name: Checkout
uses: actions/checkout@v4
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x'
- name: Build
run: dotnet build -c Release
- name: Test Core
run: |
killall nats-server 2> /dev/null | echo -n
nats-server -v
cd tests/NATS.Client.Core.Tests
dotnet test -c Release --no-build --logger:"console;verbosity=normal"
- name: Test Core2
run: |
killall nats-server 2> /dev/null | echo -n
nats-server -v
cd tests/NATS.Client.Core2.Tests
dotnet test -c Release --no-build
- name: Test CoreUnit
run: |
killall nats-server 2> /dev/null | echo -n
nats-server -v
cd tests/NATS.Client.CoreUnit.Tests
dotnet test -c Release --no-build
- name: Test JetStream
run: |
killall nats-server 2> /dev/null | echo -n
nats-server -v
cd tests/NATS.Client.JetStream.Tests
dotnet test -c Release --no-build
- name: Test KeyValueStore
run: |
killall nats-server 2> /dev/null | echo -n
nats-server -v
cd tests/NATS.Client.KeyValueStore.Tests
dotnet test -c Release --no-build
- name: Test Object Store
run: |
killall nats-server 2> /dev/null | echo -n
nats-server -v
cd tests/NATS.Client.ObjectStore.Tests
dotnet test -c Release --no-build
- name: Test Services
run: |
killall nats-server 2> /dev/null | echo -n
nats-server -v
cd tests/NATS.Client.Services.Tests
dotnet test -c Release --no-build
- name: Test Simplified
run: |
killall nats-server 2> /dev/null | echo -n
nats-server -v
cd tests/NATS.Client.Simplified.Tests
dotnet test -c Release --no-build
- name: Test OpenTelemetry
run: |
killall nats-server 2> /dev/null | echo -n
nats-server -v
cd tests/NATS.Net.OpenTelemetry.Tests
dotnet test -c Release --no-build
- name: Check Native AOT
run: |
killall nats-server 2> /dev/null | echo -n
nats-server -v
cd tests/NATS.Client.CheckNativeAot
rm -rf bin obj
# temporarily ignore MsQuicApi warnings
dotnet publish -r linux-x64 -c Release -o dist | grep -v MsQuicApi | tee output.txt
# check for warnings
grep -i warning output.txt && exit 1
cd dist
ls -lh
# make sure it's executable
file NATS.Client.CheckNativeAot
file NATS.Client.CheckNativeAot | grep ELF || exit 1
# can't be less than a meg
ls --size NATS.Client.CheckNativeAot | perl -lne'/(\d+)/; exit(1) if $1 < 1024' || exit 1
./NATS.Client.CheckNativeAot
- name: Check Documentation Examples
run: |
killall nats-server 2> /dev/null | echo -n
nats-server -v
nats-server -js &
cd tests/NATS.Net.DocsExamples
dotnet run
windows_test:
name: Windows
strategy:
fail-fast: false
matrix:
config:
- branch: 'v2.9'
- branch: 'latest'
- branch: 'main'
runs-on: windows-latest
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
NUGET_XMLDOC_MODE: skip
MSYS_NO_PATHCONV: 1
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x'
- name: Get nats-server
shell: bash
run: |
mkdir tools-nats-server && cd tools-nats-server
branch=$(curl https://api.mtmk.dev/gh/v1/releases/tag/nats-io/nats-server/${{ matrix.config.branch }})
curl -sL -o nats-server.exe "https://binaries.nats.dev/binary/github.com/nats-io/nats-server/v2?os=windows&arch=amd64&version=$branch"
cygpath -w "$(pwd)" | tee -a "$GITHUB_PATH"
- name: Check nats-server
run: nats-server -v
- name: Get tools
run: |
Invoke-WebRequest https://download.jetbrains.com/resharper/JetBrains.dotMemoryUnit.3.2.20220510.zip -OutFile dotMemoryUnit.zip
Expand-Archive dotMemoryUnit.zip
$current_path = (Get-Item .).FullName
echo "$current_path\dotMemoryUnit" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
dotnet tool install --global NUnit.ConsoleRunner.NetCore
- name: Build
run: dotnet build -c Release
- name: Memory Test (net6.0)
run: |
tasklist | grep -i nats-server && taskkill -F -IM nats-server.exe
nats-server.exe -v
dotMemoryUnit $env:userprofile\.dotnet\tools\nunit.exe --propagate-exit-code -- .\tests\NATS.Client.Core.MemoryTests\bin\Release\net6.0\NATS.Client.Core.MemoryTests.dll
- name: Platform Test
run: |
tasklist | grep -i nats-server && taskkill -F -IM nats-server.exe
nats-server.exe -v
cd tests\NATS.Client.Platform.Windows.Tests
dotnet test -c Release --no-build
# Not working on Windows reliably yet
#- name: Test Core
# run: |
# tasklist | grep -i nats-server && taskkill -F -IM nats-server.exe
# nats-server.exe -v
# cd tests/NATS.Client.Core.Tests
# dotnet test -c Release --no-build
- name: Test Core2
run: |
tasklist | grep -i nats-server && taskkill -F -IM nats-server.exe
nats-server.exe -v
cd tests/NATS.Client.Core2.Tests
dotnet test -c Release --no-build
- name: Test CoreUnit
run: |
tasklist | grep -i nats-server && taskkill -F -IM nats-server.exe
nats-server.exe -v
cd tests/NATS.Client.CoreUnit.Tests
dotnet test -c Release --no-build