-
Notifications
You must be signed in to change notification settings - Fork 12
398 lines (344 loc) · 12.6 KB
/
full-ci.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
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
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
name: Full CI
on:
push:
branches:
- master
pull_request:
types: [synchronize, labeled]
pull_request_target:
types: [labeled]
env:
GO_VERSION: '>=1.21.5'
PYTHON_VERSION: '3.10'
jobs:
full-ci-ce:
if: |
(github.event_name == 'push') ||
(github.event_name == 'pull_request' &&
github.event.action == 'labeled' &&
github.event.label.name == 'full-ci') ||
(github.event_name == 'pull_request' &&
github.event.action == 'synchronize' &&
contains(github.event.pull_request.labels.*.name, 'full-ci'))
runs-on: ubuntu-20.04
strategy:
matrix:
tarantool-version: ["1.10", "2.10", "3.0"]
fail-fast: false
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Prepare CE env
uses: ./.github/actions/prepare-ce-test-env
with:
tarantool-version: '${{ matrix.tarantool-version }}'
- name: Static code check
uses: ./.github/actions/static-code-check
- name: Unit tests
run: mage unitfull
# This server starts and listen on 8084 port that is used for tests.
- name: Stop Mono server
run: sudo systemctl kill mono-xsp4 || true
- name: Integration tests
run: mage integrationfull
full-ci-ce-linux-arm64:
if: false
runs-on: graviton
strategy:
fail-fast: false
container:
image: tarantool/testing:tt-build
options: '--init --privileged'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Install test requirements
run: |
pip3 install setuptools==59.5.0
pip3 install -r test/requirements.txt
shell: bash
- name: Install etcd
uses: ./.github/actions/setup-etcd
- name: Build test
run: mage build
- name: Unit tests
run: mage unit:fullSkipDocker
- name: Integration tests
run: mage integrationfullskipdocker
full-ci-sdk:
# Tests will run only when the pull request is labeled with `full-ci`. To
# avoid security problems, the label must be reset manually for every run.
#
# We need to use `pull_request_target` because it has access to base
# repository secrets unlike `pull_request`.
if: (github.event_name == 'push') ||
(github.event_name == 'pull_request_target' &&
github.event.action == 'labeled' &&
github.event.label.name == 'full-ci') ||
(github.event_name == 'pull_request' &&
github.event.action == 'synchronize' &&
github.event.pull_request.head.repo.full_name == github.repository &&
contains(github.event.pull_request.labels.*.name, 'full-ci'))
runs-on: ubuntu-20.04
strategy:
matrix:
sdk-version:
- "2.11.2-0-r609.linux.x86_64"
- "3.2.0-0-r40.linux.x86_64"
fail-fast: false
steps:
# `ref` as merge request is needed for pull_request_target because this
# target runs in the context of the base commit of the pull request.
- uses: actions/checkout@v4
if: github.event_name == 'pull_request_target'
with:
fetch-depth: 0
submodules: recursive
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/checkout@v4
if: github.event_name != 'pull_request_target'
with:
fetch-depth: 0
submodules: recursive
- name: Prepare EE env
uses: ./.github/actions/prepare-ee-test-env
with:
sdk-version: '${{ matrix.sdk-version }}'
sdk-download-token: '${{ secrets.SDK_DOWNLOAD_TOKEN }}'
- name: Static code check
uses: ./.github/actions/static-code-check
- name: Unit tests
run: mage unitfull
# This server starts and listen on 8084 port that is used for tests.
- name: Stop Mono server
run: sudo systemctl kill mono-xsp4 || true
- name: Integration tests
run: mage integrationfull
full-ci-macOS:
if: |
(github.event_name == 'push') ||
(github.event_name == 'pull_request' &&
github.event.action == 'labeled' &&
github.event.label.name == 'full-ci') ||
(github.event_name == 'pull_request' &&
github.event.action == 'synchronize' &&
contains(github.event.pull_request.labels.*.name, 'full-ci'))
runs-on: [self-hosted, macOS-13-self-hosted, x86_64, regular]
timeout-minutes: 90
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
brew install --overwrite go mage wget node docker colima
pip3 install -r test/requirements.txt
- name: Install etcd
uses: ./.github/actions/setup-etcd
- name: Build tt
env:
TT_CLI_BUILD_SSL: 'static'
run: mage build
- name: Install tarantool
run: |
./tt init
./tt install tarantool 3.0.2
# Delete the tt config so that it does not affect the test environment.
rm -f tt.yaml
- name: Add Tarantool to Path
run: |
echo "${GITHUB_WORKSPACE}/bin" >> $GITHUB_PATH
- name: Set Tarantool include directory to the environment
run: |
echo "TT_CLI_TARANTOOL_PREFIX=${GITHUB_WORKSPACE}/include/" >> $GITHUB_ENV
- name: Start colima and patch mount options
run: colima start --vm-type vz --mount /private/var/folders:w
- name: Run unit tests
run: mage unitfull
- name: Integration tests
run: mage integrationfull
# Etcd can be still running after integration tests when:
# 1. pytest recieve SIGALRM (can be caused by pytest-timeout plugin)
# 2. when pytest crashes
# In both cases finalizers are not invoked, so etcd is not stopped.
- name: Kill etcd, if it was left after integration tests
if: always()
run: |
ETCD_TT_BIN=${ETCD_PATH}etcd;
pkill -SIGINT -f ${ETCD_TT_BIN} || true
- name: Kill tarantool, if it was left
if: always()
run: |
TARANTOOL_BIN=${GITHUB_WORKSPACE}/bin/tarantool;
pkill -SIGINT -f ${TARANTOOL_BIN} || true
- name: Kill colima
if: always()
run: colima delete
# ee suffix means that the job runs ee integration tests.
full-ci-macOS-ee:
if: |
(github.event_name == 'push') ||
(github.event_name == 'pull_request_target' &&
github.event.action == 'labeled' &&
github.event.label.name == 'full-ci') ||
(github.event_name == 'pull_request' &&
github.event.action == 'synchronize' &&
github.event.pull_request.head.repo.full_name == github.repository &&
contains(github.event.pull_request.labels.*.name, 'full-ci'))
runs-on: macos-12
steps:
# `ref` as merge request is needed for pull_request_target because this
# target runs in the context of the base commit of the pull request.
- uses: actions/checkout@v4
if: github.event_name == 'pull_request_target'
with:
fetch-depth: 0
submodules: recursive
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/checkout@v4
if: github.event_name != 'pull_request_target'
with:
fetch-depth: 0
submodules: recursive
- name: Install dependencies
run: |
brew install --overwrite go mage
brew install python3
pip3 install -r test/requirements.txt
- name: Build tt
env:
TT_CLI_BUILD_SSL: 'static'
run: mage build
- name: Integration tests
env:
TT_CLI_EE_USERNAME: '${{ secrets.TT_EE_USERNAME }}'
TT_CLI_EE_PASSWORD: '${{ secrets.TT_EE_PASSWORD }}'
run: mage integrationee
# sdk suffix means the tests will be run on tarantool from EE SDK package.
# ee suffix means that the job runs EE integration tests.
full-ci-sdk-ee:
# Tests will run only when the pull request is labeled with `full-ci`. To
# avoid security problems, the label must be reset manually for every run.
#
# We need to use `pull_request_target` because it has access to base
# repository secrets unlike `pull_request`.
if: (github.event_name == 'push') ||
(github.event_name == 'pull_request_target' &&
github.event.action == 'labeled' &&
github.event.label.name == 'full-ci') ||
(github.event_name == 'pull_request' &&
github.event.action == 'synchronize' &&
github.event.pull_request.head.repo.full_name == github.repository &&
contains(github.event.pull_request.labels.*.name, 'full-ci'))
runs-on: ubuntu-20.04
strategy:
matrix:
sdk-version:
- "2.11.2-0-r609.linux.x86_64"
- "3.2.0-0-r40.linux.x86_64"
fail-fast: false
steps:
# `ref` as merge request is needed for pull_request_target because this
# target runs in the context of the base commit of the pull request.
- uses: actions/checkout@v4
if: github.event_name == 'pull_request_target'
with:
fetch-depth: 0
submodules: recursive
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/checkout@v4
if: github.event_name != 'pull_request_target'
with:
fetch-depth: 0
submodules: recursive
- name: Prepare EE env
uses: ./.github/actions/prepare-ee-test-env
with:
sdk-version: '${{ matrix.sdk-version }}'
sdk-download-token: '${{ secrets.SDK_DOWNLOAD_TOKEN }}'
- name: Install dependencies
run: |
pip3 install -r test/requirements.txt
- name: Integration tests
env:
TT_CLI_EE_USERNAME: '${{ secrets.TT_EE_USERNAME }}'
TT_CLI_EE_PASSWORD: '${{ secrets.TT_EE_PASSWORD }}'
run: mage integrationee
# ce suffix means that the job will be run on CE tarantool.
# ee suffix means that the job runs EE integration tests.
full-ci-ce-ee:
if: |
(github.event_name == 'push') ||
(github.event_name == 'pull_request_target' &&
github.event.action == 'labeled' &&
github.event.label.name == 'full-ci') ||
(github.event_name == 'pull_request' &&
github.event.action == 'synchronize' &&
github.event.pull_request.head.repo.full_name == github.repository &&
contains(github.event.pull_request.labels.*.name, 'full-ci'))
runs-on: ubuntu-20.04
strategy:
matrix:
tarantool-version: ["1.10", "2.10"]
fail-fast: false
steps:
# `ref` as merge request is needed for pull_request_target because this
# target runs in the context of the base commit of the pull request.
- uses: actions/checkout@v4
if: github.event_name == 'pull_request_target'
with:
fetch-depth: 0
submodules: recursive
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/checkout@v4
if: github.event_name != 'pull_request_target'
with:
fetch-depth: 0
submodules: recursive
- name: Prepare CE env
uses: ./.github/actions/prepare-ce-test-env
with:
tarantool-version: '${{ matrix.tarantool-version }}'
- name: Install dependencies
run: |
pip3 install -r test/requirements.txt
- name: Integration tests
env:
TT_CLI_EE_USERNAME: '${{ secrets.TT_EE_USERNAME }}'
TT_CLI_EE_PASSWORD: '${{ secrets.TT_EE_PASSWORD }}'
run: mage integrationee
# Integration tests on the system without Tarantool installed.
full-ci-ce-no-tarantool:
if: |
(github.event_name == 'push') ||
(github.event_name == 'pull_request' &&
github.event.action == 'labeled' &&
github.event.label.name == 'full-ci') ||
(github.event_name == 'pull_request' &&
github.event.action == 'synchronize' &&
contains(github.event.pull_request.labels.*.name, 'full-ci'))
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Prepare CE env
uses: ./.github/actions/prepare-ce-test-env
with:
tarantool-version: '2.10.6'
skip-tarantool-install: true
- name: Install dependencies
run: |
pip3 install -r test/requirements.txt
- name: Integration tests
run: mage integrationnotarantool