-
Notifications
You must be signed in to change notification settings - Fork 913
346 lines (305 loc) · 11.4 KB
/
Copy pathbuild_test.yml
File metadata and controls
346 lines (305 loc) · 11.4 KB
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
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
name: test
on:
push:
branches:
- master
- 'release-**'
pull_request:
branches:
- master
- 'release-**'
jobs:
unit_test:
strategy:
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm]
name: unit tests
runs-on: ${{ matrix.os }}
services:
mysql:
image: mysql:8.0
ports:
- 3306
env:
MYSQL_ROOT_PASSWORD: password
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
postgres:
image: postgres:10.0
ports:
- 5432
env:
POSTGRES_USER: gorse
POSTGRES_PASSWORD: gorse_pass
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
mongo:
image: mongo:6
ports:
- 27017
env:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: password
options: >-
--health-cmd mongosh
--health-interval 10s
--health-timeout 5s
--health-retries 5
clickhouse:
image: clickhouse/clickhouse-server:26.2
ports:
- 8123
env:
CLICKHOUSE_USER: gorse
CLICKHOUSE_PASSWORD: gorse_pass
options: >-
--health-cmd="clickhouse-client --query 'SELECT 1'"
--health-interval=10s
--health-timeout=5s
--health-retries=5
redis:
image: redis:8
ports:
- 6379
rustfs:
image: rustfs/rustfs:alpha
ports:
- 9000
env:
RUSTFS_ACCESS_KEY: rustfsadmin
RUSTFS_SECRET_KEY: rustfsadmin
qdrant:
image: qdrant/qdrant:latest
ports:
- 6334
weaviate:
image: cr.weaviate.io/semitechnologies/weaviate:1.35.7
ports:
- 8080
steps:
- name: Set up dataset
run: |
mkdir -p ~/.gorse/dataset
mkdir -p ~/.gorse/download
wget https://cdn.gorse.io/datasets/ml-100k.zip -P ~/.gorse/download
wget https://cdn.gorse.io/datasets/ml-1m.zip -P ~/.gorse/download
wget https://cdn.gorse.io/datasets/pinterest-20.zip -P ~/.gorse/download
wget https://cdn.gorse.io/datasets/frappe.zip -P ~/.gorse/download
wget https://cdn.gorse.io/datasets/ml-tag.zip -P ~/.gorse/download
wget https://cdn.gorse.io/datasets/criteo.zip -P ~/.gorse/download
wget https://cdn.gorse.io/datasets/mnist.zip -P ~/.gorse/download
unzip ~/.gorse/download/ml-100k.zip -d ~/.gorse/dataset
unzip ~/.gorse/download/ml-1m.zip -d ~/.gorse/dataset
unzip ~/.gorse/download/pinterest-20.zip -d ~/.gorse/dataset
unzip ~/.gorse/download/frappe.zip -d ~/.gorse/dataset
unzip ~/.gorse/download/ml-tag.zip -d ~/.gorse/dataset
unzip ~/.gorse/download/criteo.zip -d ~/.gorse/dataset
unzip ~/.gorse/download/mnist.zip -d ~/.gorse/dataset
- uses: actions/checkout@v2
- uses: actions/setup-go@v5
with:
go-version-file: ./go.mod
- name: Install and start Azurite
uses: potatoqualitee/azuright@v1
- name: Setup Milvus
run: |
curl -sfL https://raw.githubusercontent.com/milvus-io/milvus/6da09b8b02b1/scripts/standalone_embed.sh -o standalone_embed.sh
bash standalone_embed.sh start
working-directory: ${{ runner.temp }}
- name: Test
run: go test -timeout 30m ./... -coverprofile=coverage.txt -covermode=atomic -coverpkg=./...
env:
# MySQL
MYSQL_URI: mysql://root:password@tcp(localhost:${{ job.services.mysql.ports[3306] }})/
# Postgres
POSTGRES_URI: postgres://gorse:gorse_pass@localhost:${{ job.services.postgres.ports[5432] }}/
# MongoDB
MONGO_URI: mongodb://root:password@localhost:${{ job.services.mongo.ports[27017] }}/
# ClickHouse
CLICKHOUSE_URI: clickhouse://gorse:gorse_pass@localhost:${{ job.services.clickhouse.ports[8123] }}/
# Redis
REDIS_URI: redis://localhost:${{ job.services.redis.ports[6379] }}/
# S3
S3_ENDPOINT: localhost:${{ job.services.rustfs.ports[9000] }}
S3_ACCESS_KEY_ID: rustfsadmin
S3_SECRET_ACCESS_KEY: rustfsadmin
# Azure Blob (Azurite)
AZURE_STORAGE_CONNECTION_STRING: DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;
# Qdrant
QDRANT_URI: qdrant://localhost:${{ job.services.qdrant.ports[6334] }}/
# Weaviate
WEAVIATE_URI: weaviate://localhost:${{ job.services.weaviate.ports[8080] }}/
- name: Upload coverage to Codecov
if: matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v5
with:
files: ./coverage.txt
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
unit_test_macos:
name: unit tests (macos-latest)
runs-on: macos-latest
steps:
- name: Set up dataset
run: |
mkdir -p ~/.gorse/dataset
mkdir -p ~/.gorse/download
wget https://cdn.gorse.io/datasets/ml-100k.zip -P ~/.gorse/download
wget https://cdn.gorse.io/datasets/ml-1m.zip -P ~/.gorse/download
wget https://cdn.gorse.io/datasets/pinterest-20.zip -P ~/.gorse/download
wget https://cdn.gorse.io/datasets/frappe.zip -P ~/.gorse/download
wget https://cdn.gorse.io/datasets/ml-tag.zip -P ~/.gorse/download
wget https://cdn.gorse.io/datasets/criteo.zip -P ~/.gorse/download
wget https://cdn.gorse.io/datasets/mnist.zip -P ~/.gorse/download
unzip ~/.gorse/download/ml-100k.zip -d ~/.gorse/dataset
unzip ~/.gorse/download/ml-1m.zip -d ~/.gorse/dataset
unzip ~/.gorse/download/pinterest-20.zip -d ~/.gorse/dataset
unzip ~/.gorse/download/frappe.zip -d ~/.gorse/dataset
unzip ~/.gorse/download/ml-tag.zip -d ~/.gorse/dataset
unzip ~/.gorse/download/criteo.zip -d ~/.gorse/dataset
unzip ~/.gorse/download/mnist.zip -d ~/.gorse/dataset
- uses: actions/checkout@v2
- uses: actions/setup-go@v5
with:
go-version-file: ./go.mod
- name: Test
run: go test -timeout 20m ./...
unit_test_windows:
strategy:
matrix:
os: [windows-latest, windows-11-arm]
name: unit tests
runs-on: ${{ matrix.os }}
steps:
- name: Set up dataset
run: |
New-Item -Type Directory -Path ~/.gorse/dataset
New-Item -Type Directory -Path ~/.gorse/download
Invoke-WebRequest https://cdn.gorse.io/datasets/ml-100k.zip -OutFile ~/.gorse/download/ml-100k.zip
Invoke-WebRequest https://cdn.gorse.io/datasets/ml-1m.zip -OutFile ~/.gorse/download/ml-1m.zip
Invoke-WebRequest https://cdn.gorse.io/datasets/pinterest-20.zip -OutFile ~/.gorse/download/pinterest-20.zip
Invoke-WebRequest https://cdn.gorse.io/datasets/frappe.zip -OutFile ~/.gorse/download/frappe.zip
Invoke-WebRequest https://cdn.gorse.io/datasets/ml-tag.zip -OutFile ~/.gorse/download/ml-tag.zip
Invoke-WebRequest https://cdn.gorse.io/datasets/criteo.zip -OutFile ~/.gorse/download/criteo.zip
Invoke-WebRequest https://cdn.gorse.io/datasets/mnist.zip -OutFile ~/.gorse/download/mnist.zip
Expand-Archive ~/.gorse/download/ml-100k.zip -DestinationPath ~/.gorse/dataset
Expand-Archive ~/.gorse/download/ml-1m.zip -DestinationPath ~/.gorse/dataset
Expand-Archive ~/.gorse/download/pinterest-20.zip -DestinationPath ~/.gorse/dataset
Expand-Archive ~/.gorse/download/frappe.zip -DestinationPath ~/.gorse/dataset
Expand-Archive ~/.gorse/download/ml-tag.zip -DestinationPath ~/.gorse/dataset
Expand-Archive ~/.gorse/download/criteo.zip -DestinationPath ~/.gorse/dataset
Expand-Archive ~/.gorse/download/mnist.zip -DestinationPath ~/.gorse/dataset
- uses: actions/checkout@v2
- uses: actions/setup-go@v5
with:
go-version-file: ./go.mod
- name: Test
run: go test -timeout 20m ./...
integrate_test:
name: integrate tests
runs-on: ubuntu-latest
strategy:
matrix:
database: [mysql, postgres, mongo, sqlite]
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version-file: ./go.mod
- uses: cuchi/jinja2-action@v1.2.0
with:
template: client/docker-compose.yml.j2
output_file: docker-compose.yml
strict: true
variables: |
database=${{ matrix.database }}
- name: Setup test
run: ./client/setup-test.sh
env:
DOCKER_BUILDKIT: 1
- name: Test
run: go test ./client/
env:
GORSE_SERVER_ENDPOINT: http://localhost:8087
GORSE_DASHBOARD_ENDPOINT: http://localhost:8088
compat_test:
name: compatibility tests
runs-on: ubuntu-latest
services:
mariadb:
image: mariadb:10.2
ports:
- 3306
env:
MYSQL_ROOT_PASSWORD: password
kvrocks:
image: apache/kvrocks:nightly
ports:
- 6666
steps:
- name: Install pre-requisites
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: qemu-user-static
- name: Setup Redis cluster
uses: gorse-cloud/redis-cluster@v1.0.0
- uses: actions/checkout@v2
- uses: actions/setup-go@v5
with:
go-version-file: ./go.mod
- name: Test RISC-V floats
run: make -C common/floats test-rvv
env:
RISCV64_QEMU: qemu-riscv64-static
- name: Test LoongArch LASX floats
run: make -C common/floats test-lasx
env:
LOONG64_QEMU: qemu-loongarch64-static
- name: Test MariaDB
run: go test ./storage/data ./storage/cache -run TestMySQL
env:
MYSQL_URI: mysql://root:password@tcp(localhost:${{ job.services.mariadb.ports[3306] }})/
- name: Test Kvrocks
run: go test ./storage/cache -run ^TestRedis
env:
REDIS_URI: redis://localhost:${{ job.services.kvrocks.ports[6666] }}/
- name: Test Redis cluster (1 address)
run: go test ./storage/cache -run ^TestRedis
env:
REDIS_URI: redis+cluster://localhost:7000
- name: Test Redis cluster (6 addresses)
run: go test ./storage/cache -run ^TestRedis
env:
REDIS_URI: redis+cluster://localhost:7000?addr=localhost:7001&addr=localhost:7002&addr=localhost:7003&addr=localhost:7004&addr=localhost:7005
playground:
name: playground
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build Docker image
run: docker build -t zhenghaoz/gorse-in-one -f ./cmd/gorse-in-one/Dockerfile .
- name: Run playground
run: docker run -d -p 8088:8088 --name playground zhenghaoz/gorse-in-one --playground
- name: Check dashboard URL
run: |
for i in {1..10}; do
curl -sSf http://localhost:8088 && break
docker logs playground
sleep 10
done
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v5
with:
go-version-file: ./go.mod
- name: golangci-lint
uses: golangci/golangci-lint-action@v9
with:
args: --timeout 20m