-
Notifications
You must be signed in to change notification settings - Fork 29
280 lines (245 loc) · 7.89 KB
/
backend-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
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
name: Backend Test
on:
push:
paths-ignore:
- 'rst/**'
- '.github/workflows/*-translation.yml'
workflow_dispatch:
env:
# Skip building frontend in tt rocks make
CMAKE_DUMMY_WEBUI: true
# Prerequisite for some etcd-related tests
ETCD_PATH: etcd-v2.3.8/etcd
jobs:
misc:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '16.8.0'
- uses: actions/setup-python@v5
with:
python-version: '3.10.0'
# Setup sphinx
- name: Cache pip packages
uses: actions/cache@v4
id: cache-venv
with:
path: ./venv
key: misc-venv-${{ hashFiles('rst/requirements.txt') }}-03
-
run: |
python -m venv ./venv && . ./venv/bin/activate
pip install -r rst/requirements.txt
if: steps.cache-venv.outputs.cache-hit != 'true'
# Setup tarantool
- uses: tarantool/setup-tarantool@v3
with:
tarantool-version: '1.10'
- name: Setup tt
run: |
curl -L https://tarantool.io/release/2/installer.sh | sudo bash
sudo apt install -y tt
tt version
# Setup luacheck and ldoc
- name: Cache rocks
uses: actions/cache@v4
id: cache-rocks
with:
path: .rocks/
key: misc-rocks-${{ hashFiles('*.rockspec') }}-02
-
run: |
tt rocks install luacheck
tt rocks install ldoc --server=https://tarantool.github.io/LDoc/
if: steps.cache-rocks.outputs.cache-hit != 'true'
# Setup graphql cli
- name: Cache npm
uses: actions/cache@v4
id: cache-npm
with:
path: node_modules
key: npm-02
-
run: npm install graphql-cli@3.0.14
if: steps.cache-npm.outputs.cache-hit != 'true'
# Run tests
- run: .rocks/bin/luacheck .
- name: Run tt rocks make
run: |
. ./venv/bin/activate
tt rocks make
env:
CMAKE_LDOC_FIND_REQUIRED: 'YES'
CMAKE_SPHINX_FIND_REQUIRED: 'YES'
- run: ./fetch-schema.sh
- run: cmake -DJUST_CHECK=YES -P rst/BuildUML.cmake
# Cleanup cached paths
- run: tt rocks remove cartridge
run-tests:
strategy:
fail-fast: false
matrix:
tarantool: ['1.10', '2.7', '2.8', '2.10', '2.11']
etcd: ['v2.3.8']
metrics: ['']
include:
- tarantool: '2.11'
etcd: 'v3.5.0'
metrics: ''
- tarantool: '2.11'
etcd: 'v2.3.8'
metrics: '1.2.0'
runs-on: ubuntu-20.04
steps:
- uses: actions/setup-python@v5
with:
python-version: '3.9.8'
- uses: actions/checkout@v4
- if: matrix.tarantool != 'latest'
uses: tarantool/setup-tarantool@v3
with:
tarantool-version: '${{ matrix.tarantool }}'
- if: matrix.tarantool == 'latest'
run: |
curl -L https://tarantool.io/pre-release/2/installer.sh | bash
sudo apt-get -y install tarantool
- name: Set up etcd
uses: tarantool/actions/setup-etcd@master
with:
version: '${{ matrix.etcd }}'
install-prefix: etcd-${{ matrix.etcd }}
- run: echo "ETCD_PATH=etcd-${{ matrix.etcd }}/etcd" >> $GITHUB_ENV
- name: Setup tt
run: |
curl -L https://tarantool.io/release/2/installer.sh | sudo bash
sudo apt install -y tt
tt version
# Setup luatest
- name: Cache rocks
uses: actions/cache@v4
id: cache-rocks
with:
path: .rocks/
key: test-rocks-${{ hashFiles('*.rockspec') }}-04
-
run: tt rocks install luatest 1.0.1
if: steps.cache-rocks.outputs.cache-hit != 'true'
# Setup pytest
- name: Cache pytest
uses: actions/cache@v4
id: cache-pytest
with:
path: ./pytest-venv
key: test-venv-${{ hashFiles('test/integration/requirements.txt') }}-03
-
run: |
python -m venv ./pytest-venv && . ./pytest-venv/bin/activate
pip install -r test/integration/requirements.txt
if: steps.cache-pytest.outputs.cache-hit != 'true'
# Setup optional rocks
- name: Install metrics
if: matrix.metrics != ''
run: tt rocks install metrics ${{ matrix.metrics }}
- run: tt rocks make
# Stop Mono server. This server starts and listens to 8084 port that is
# used for tests.
- name: 'Stop Mono server'
run: sudo kill -9 $(sudo lsof -t -i tcp:8084) || true
- uses: nick-fields/retry@v3
with:
max_attempts: 3
retry_on: error
timeout_minutes: 30
command: |
.rocks/bin/luatest -v --fail-fast
- name: Run pytest -v
run: |
. ./pytest-venv/bin/activate
pytest -v
# Cleanup cached paths
- run: tt rocks remove cartridge
tests-ee:
if: |
github.event_name == 'push'
runs-on: ubuntu-20.04
strategy:
matrix:
sdk-version: [
"gc64-2.11.2-0-r609",
"nogc64-2.11.2-0-r609",
]
etcd: ['v2.3.8', 'v3.5.0']
fail-fast: false
steps:
- uses: actions/setup-python@v5
with:
python-version: '3.9.8'
- uses: actions/checkout@v4
- name: Cache Tarantool SDK
id: cache-sdk
uses: actions/cache@v4
with:
path: tarantool-enterprise
key: ${{ matrix.sdk-version }}
- name: Download Tarantool SDK
if: steps.cache-sdk.outputs.cache-hit != 'true'
run: |
ARCHIVE_NAME=tarantool-enterprise-sdk-${{ matrix.sdk-version }}.linux.x86_64.tar.gz
curl -O -L \
https://tarantool:${{ secrets.CARTRIDGE_SDK_DOWNLOAD_TOKEN }}@download.tarantool.io/enterprise/release/linux/x86_64/2.11/${ARCHIVE_NAME}
tar -xzf ${ARCHIVE_NAME}
rm -f ${ARCHIVE_NAME}
source tarantool-enterprise/env.sh
- name: Add SDK to PATH and set TARANTOOL_SDK_PATH variable
run: |
SDK_PATH="$(realpath tarantool-enterprise)"
TT_CLI_REPO_ROCKS="$(realpath tarantool-enterprise)/rocks"
echo "${SDK_PATH}" >> ${GITHUB_PATH}
echo "TARANTOOL_SDK_PATH=${SDK_PATH}" >> ${GITHUB_ENV}
echo "TT_CLI_REPO_ROCKS=${TT_CLI_REPO_ROCKS}" >> ${GITHUB_ENV}
- name: Set up etcd
uses: tarantool/actions/setup-etcd@master
with:
version: '${{ matrix.etcd }}'
install-prefix: etcd-${{ matrix.etcd }}
- run: echo "ETCD_PATH=etcd-${{ matrix.etcd }}/etcd" >> $GITHUB_ENV
# Setup luatest
- name: 'Install luatest'
run: |
source tarantool-enterprise/env.sh
tt rocks install luatest 1.0.1
# Setup pytest
- name: Cache pytest
uses: actions/cache@v4
id: cache-pytest
with:
path: ./pytest-venv
key: test-venv-${{ hashFiles('test/integration/requirements.txt') }}-03
-
run: |
python -m venv ./pytest-venv && . ./pytest-venv/bin/activate
pip install -r test/integration/requirements.txt
if: steps.cache-pytest.outputs.cache-hit != 'true'
- name: 'tt rocks make'
run: |
source tarantool-enterprise/env.sh
tt rocks make
# Stop Mono server. This server starts and listens to 8084 port that is
# used for tests.
- name: 'Stop Mono server'
run: sudo kill -9 $(sudo lsof -t -i tcp:8084) || true
- uses: nick-fields/retry@v3
with:
max_attempts: 3
retry_on: error
timeout_minutes: 30
command: |
.rocks/bin/luatest -v --fail-fast
- name: Run pytest -v
run: |
. ./pytest-venv/bin/activate
pytest -v
# Cleanup cached paths
- run: tt rocks remove cartridge