-
Notifications
You must be signed in to change notification settings - Fork 55
134 lines (110 loc) · 4.15 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
name: Test
on:
pull_request: {}
push:
branches:
- main
jobs:
dotnet:
name: dotnet
strategy:
fail-fast: false
matrix:
config:
- branch: 'v2.9.22'
- branch: 'v2.10.9'
- 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: |
for i in 1 2 3
do
curl -sf https://binaries.nats.dev/nats-io/nats-server/v2@${{ matrix.config.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@v3
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.x'
- name: Build
run: dotnet build -c Debug
- name: Test Core
run: dotnet test -c Debug --no-build --logger:"console;verbosity=normal" tests/NATS.Client.Core.Tests/NATS.Client.Core.Tests.csproj
- name: Test JetStream
run: dotnet test -c Debug --no-build --logger:"console;verbosity=normal" tests/NATS.Client.JetStream.Tests/NATS.Client.JetStream.Tests.csproj
- name: Test Key/Value Store
run: dotnet test -c Debug --no-build --logger:"console;verbosity=normal" tests/NATS.Client.KeyValueStore.Tests/NATS.Client.KeyValueStore.Tests.csproj
- name: Test Object Store
run: dotnet test -c Debug --no-build --logger:"console;verbosity=normal" tests/NATS.Client.ObjectStore.Tests/NATS.Client.ObjectStore.Tests.csproj
- name: Test Services
run: dotnet test -c Debug --no-build --logger:"console;verbosity=normal" tests/NATS.Client.Services.Tests/NATS.Client.Services.Tests.csproj
- name: Check Native AOT
run: |
cd tests/NATS.Client.CheckNativeAot
rm -rf bin obj
dotnet publish -r linux-x64 -c Release -o dist | 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
memory_test:
name: memory test
strategy:
fail-fast: false
matrix:
config:
- branch: 'v2.9.22'
- branch: 'v2.10.9'
- branch: 'main'
runs-on: windows-latest
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
NUGET_XMLDOC_MODE: skip
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.x'
- name: Get nats-server
shell: bash
run: |
mkdir tools-nats-server && cd tools-nats-server
for i in 1 2 3
do
curl -sf https://binaries.nats.dev/nats-io/nats-server/v2@${{ matrix.config.branch }} | PREFIX=. sh && break || sleep 30
done
mv nats-server nats-server.exe
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
nuget install NUnit.ConsoleRunner -version 3.16.3
$current_path = (Get-Item .).FullName
echo "$current_path\dotMemoryUnit" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Build
run: dotnet build -c Debug
- name: Memory Test
run: dotMemoryUnit .\NUnit.ConsoleRunner.3.16.3\tools\nunit3-console.exe --propagate-exit-code -- .\tests\NATS.Client.Core.MemoryTests\bin\Debug\net6.0\NATS.Client.Core.MemoryTests.dll