-
Notifications
You must be signed in to change notification settings - Fork 78
316 lines (316 loc) · 9.45 KB
/
tests.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
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
#name: PR pre-merge tests
#
#env:
# LOWEST_SUPPORTED_NODEJS_VERSION: '18'
# LOWEST_SUPPORTED_NODE_MODULE: 'v108'
#
## Trigger test workflow whenever:
## 1. A pull request is updated (e.g with new commits)
## 2. Commits are pushed directly to the stage or master branch
#on:
# push:
# branches: ["stage", "master"]
# pull_request:
# branches: ["stage"]
# types: [
# # Default triggers
# opened,
# synchronize,
# reopened,
# # Additional triggers
# labeled,
# unlabeled
# ]
# workflow_dispatch:
#
#jobs:
# lint:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# with:
# submodules: recursive
# - name: install standard
# run: npm install standard
# - name: lint
# run: npm run lint
#
# build-ubuntu:
# runs-on: ubuntu-latest
# strategy:
# matrix:
# nodejs-version: ["18", "20", "21"]
# fail-fast: false
#
#
# steps:
# - uses: actions/checkout@v4
# with:
# submodules: recursive
#
# - uses: actions/setup-node@v4
# with:
# node-version: ${{ matrix.nodejs-version }}
# architecture: 'x64'
# - name: debugging
# run: |
# echo "LOWEST_SUPPORTED_NODEJS_VERSION: $LOWEST_SUPPORTED_NODEJS_VERSION"
#
# - run: sudo apt update
# - name: Install build dependencies (C Client dependency packages)
# run: sudo apt install g++ libssl-dev zlib1g-dev;
# - name: Install build dependencies (make)
# run: sudo apt-get install -y make;
# - name: Install build dependencies (make)
# run: sudo apt install build-essential;
#
# - name: Build client
# run: |
# ./scripts/build-c-client.sh
# npm install
# env:
# CFLAGS: '-Werror'
#
# - name: list
# run: ls lib/binding
# - name: Send binding to test jobs
# uses: actions/upload-artifact@v4
# with:
# name: binding-${{ matrix.nodejs-version }}
# path: ./lib/binding/node-*-linux-x64/
#
## test-memray:
## needs: build-ubuntu
## runs-on: ubuntu-latest
## steps:
## - uses: actions/checkout@v4
##
## - uses: actions/setup-node@v4
## with:
## node-version: ${{ matrix.nodejs-version }}
## architecture: 'x64'
##
## - uses: actions/download-artifact@v4
## with:
## name: binding-18
##
## - name: make binding folder
## run: mkdir lib/binding
##
## - name: Install client
## run: cp -r install node-v108-linux-x64 lib/binding/node-v108-linux-x64
##
## - name: Install client
## run: npm install .
##
## - name: Run Aerospike server
## run: docker run -d --name aerospike -p 3000-3002:3000-3002 aerospike/aerospike-server
##
## - name: Wait for database to be ready
## # Should be ready after 3 seconds
## run: sleep 3
##
## - name: Get number of tests
## run: echo "NUM_TESTS=$(npm run test-dry-run | grep -oP '\d+ (passing|pending)' | awk '{ sum += $1 } END { print sum }')" >> $GITHUB_ENV
## working-directory: test
##
## - name: Run tests
## # Get number of tests since setting to 0 doesn't work properly
## # pytest-memray currently throws a ZeroDivision error due to having a bug
## # We ignore this for now
## run: python -m pytest ./new_tests --memray --memray-bin-path=./ --most-allocations=${{ env.NUM_TESTS }} || true
## working-directory: test
#
# # Run this when testing new server features on server release candidate
# # to make sure the tests don't regress on the last server release.
# test-ce-latest-release:
# runs-on: ubuntu-latest
# if: ${{ contains(github.event.pull_request.labels.*.name, 'new-server-features') }}
# needs: build-ubuntu
#
# steps:
# - uses: actions/checkout@v4
# with:
# submodules: recursive
# - name: debugging
# run: |
# echo "LOWEST_SUPPORTED_NODEJS_VERSION: $LOWEST_SUPPORTED_NODEJS_VERSION"
# - uses: actions/setup-node@v4
# with:
# node-version: ${{ env.LOWEST_SUPPORTED_NODEJS_VERSION }}
# architecture: 'x64'
#
# - uses: actions/download-artifact@v4
# with:
# name: binding-${{ env.LOWEST_SUPPORTED_NODEJS_VERSION }}
# env:
# LOWEST_SUPPORTED_NODEJS_VERSION: ${{ env.LOWEST_SUPPORTED_NODEJS_VERSION }}
#
#
# - name: make binding folder
# run: mkdir lib/binding
#
# - name: Install client
# run: cp -r node-${{ env.LOWEST_SUPPORTED_NODE_MODULE }}-linux-x64 lib/binding/node-${{ env.LOWEST_SUPPORTED_NODE_MODULE }}-linux-x64
#
# - name: Run Aerospike server
# run: docker run -d --name aerospike -p 3000-3002:3000-3002 aerospike/aerospike-server
#
# - name: Wait for database to be ready
# # Should be ready after 3 seconds
# run: sleep 3
#
# - name: Run tests
# run: npm run test
#
# test-ce:
# runs-on: ubuntu-latest
# needs: build-ubuntu
# strategy:
# matrix:
# node-version: [
# "18",
# "20",
# "21"
# ]
# fail-fast: false
#
# steps:
# - uses: actions/checkout@v2
# with:
# submodules: recursive
#
# - uses: actions/setup-node@v4
# with:
# node-version: ${{ matrix.node-version }}
# architecture: 'x64'
#
# - uses: actions/download-artifact@v4
# with:
# name: binding-${{ matrix.node-version }}
#
# - name: make binding folder
# run: mkdir lib/binding
#
# - name: install mocha
# run: npm install mocha
#
# - name: Install client
# #fix the convention here
# run: |
# if [ "${{ matrix.node-version }}" = "18" ]; then
# cp -r node-v108-linux-x64 lib/binding/node-v108-linux-x64
# elif [ "${{ matrix.node-version }}" = "20" ]; then
# cp -r node-v115-linux-x64 lib/binding/node-v115-linux-x64
# elif [ "${{ matrix.node-version }}" = "21" ]; then
# cp -r node-v120-linux-x64 lib/binding/node-v120-linux-x64
# fi
#
# - if: ${{ contains(github.event.pull_request.labels.*.name, 'new-server-features') }}
# uses: docker/login-action@v3
# with:
# username: ${{ secrets.DOCKER_HUB_BOT_USERNAME }}
# password: ${{ secrets.DOCKER_HUB_BOT_PW }}
#
# - name: Run Aerospike server release candidate with latest tag
# if: ${{ contains(github.event.pull_request.labels.*.name, 'new-server-features') }}
# run: docker run -d --name aerospike -p 3000-3002:3000-3002 aerospike/aerospike-server-rc:latest
#
# - name: Run Aerospike server
# if: ${{ !contains(github.event.pull_request.labels.*.name, 'new-server-features') }}
# run: docker run -d --name aerospike -p 3000-3002:3000-3002 aerospike/aerospike-server
#
# - name: Wait for database to be ready
# # Should be ready after 3 seconds
# run: sleep 3
#
# - name: Run tests
# run: npm run test
#
# test-lowest-supported-server:
# runs-on: ubuntu-latest
# needs: build-ubuntu
# steps:
# - uses: actions/checkout@v2
# with:
# submodules: recursive
#
# - uses: actions/setup-node@v4
# with:
# node-version: ${{ env.LOWEST_SUPPORTED_NODEJS_VERSION }}
# architecture: 'x64'
#
# - uses: actions/download-artifact@v4
# with:
# name: binding-${{ env.LOWEST_SUPPORTED_NODEJS_VERSION }}
# env:
# LOWEST_SUPPORTED_NODEJS_VERSION: ${{ env.LOWEST_SUPPORTED_NODEJS_VERSION }}
#
# - name: make binding folder
# run: mkdir lib/binding
#
# - name: install mocha
# run: npm install mocha
#
# - name: Install client
# #fix the convention here
# run: cp -r node-${{ env.LOWEST_SUPPORTED_NODE_MODULE }}-linux-x64 lib/binding/node-${{ env.LOWEST_SUPPORTED_NODE_MODULE }}-linux-x64
#
# - name: Run lowest supported server
# run: |
# SERVER_VERSION=$(curl -s "https://registry.hub.docker.com/v2/repositories/aerospike/aerospike-server/tags?page_size=100" | jq '.results[] | select(.name | startswith("6.0")).name' -r | head -n 1)
# docker run -d --name aerospike -p 3000-3002:3000-3002 aerospike/aerospike-server:$SERVER_VERSION
#
# - name: Wait for database to be ready
# # Should be ready after 3 seconds
# run: sleep 3
#
# - name: Run tests
# run: npm run test
#
# test-ee:
# runs-on: ubuntu-latest
# needs: build-ubuntu
# steps:
# - uses: actions/checkout@v2
# with:
# submodules: recursive
#
# - uses: actions/setup-node@v4
# with:
# node-version: ${{ env.LOWEST_SUPPORTED_NODEJS_VERSION }}
# architecture: 'x64'
#
# - uses: actions/download-artifact@v4
# with:
# name: binding-${{ env.LOWEST_SUPPORTED_NODEJS_VERSION }}
# env:
# LOWEST_SUPPORTED_NODEJS_VERSION: ${{ env.LOWEST_SUPPORTED_NODEJS_VERSION }}
#
# - name: make binding folder
# run: mkdir lib/binding
#
# - name: install mocha
# run: npm install mocha
#
# - name: Install client
# #fix the convention here
# run: cp -r node-${{ env.LOWEST_SUPPORTED_NODE_MODULE }}-linux-x64 lib/binding/node-${{ env.LOWEST_SUPPORTED_NODE_MODULE }}-linux-x64
#
# - uses: ./.github/actions/run-ee-server
# with:
# use-server-rc: ${{ contains(github.event.pull_request.labels.*.name, 'new-server-features') }}
# docker-hub-username: ${{ secrets.DOCKER_HUB_BOT_USERNAME }}
# docker-hub-password: ${{ secrets.DOCKER_HUB_BOT_PW }}
#
# - name: Wait for server to start
# run: sleep 5
#
# - name: Run tests
# run: npm run test -- --h localhost --U superuser --P superuser
#
# - name: Show logs if failed
# if: ${{ failure() }}
# run: |
# docker container logs aerospike
# cat ./configs/aerospike.conf