-
Notifications
You must be signed in to change notification settings - Fork 29
222 lines (196 loc) · 6.18 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
name: Backend Test
on:
push:
paths-ignore:
- 'rst/**'
- '.github/workflows/*-translation.yml'
workflow_dispatch:
env:
# Skip building frontend in tarantoolctl rocks make
CMAKE_DUMMY_WEBUI: true
# Prerequisite for some etcd-related tests
ETCD_PATH: etcd-v2.3.8/etcd
jobs:
misc:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '16.8.0'
- uses: actions/setup-python@v2
with:
python-version: '3.10.0'
# Setup sphinx
- name: Cache pip packages
uses: actions/cache@v2
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@v1
with:
tarantool-version: '1.10'
# Setup luacheck and ldoc
- name: Cache rocks
uses: actions/cache@v2
id: cache-rocks
with:
path: .rocks/
key: misc-rocks-${{ hashFiles('*.rockspec') }}-02
-
run: |
tarantoolctl rocks install luacheck
tarantoolctl 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@v2
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 tarantoolctl rocks make
run: |
. ./venv/bin/activate
tarantoolctl 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: tarantoolctl rocks remove cartridge
run-tests:
strategy:
fail-fast: false
matrix:
tarantool: ['1.10', '2.7', '2.8', '2.10']
runs-on: ubuntu-18.04
steps:
- uses: actions/setup-python@v2
with:
python-version: '3.9.8'
- uses: actions/checkout@v2
- if: matrix.tarantool != 'latest'
uses: tarantool/setup-tarantool@v1
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
# Setup etcd
- name: Install etcd
uses: ./.github/actions/setup-etcd
if: runner.os == 'Linux'
with:
etcd-version: v2.3.8
install-prefix: etcd-v2.3.8
# Setup luatest
- name: Cache rocks
uses: actions/cache@v2
id: cache-rocks
with:
path: .rocks/
key: test-rocks-${{ hashFiles('*.rockspec') }}-03
-
run: tarantoolctl rocks install luatest 0.5.7
if: steps.cache-rocks.outputs.cache-hit != 'true'
# Setup pytest
- name: Cache pytest
uses: actions/cache@v2
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'
- run: tarantoolctl rocks make
- run: .rocks/bin/luatest -v
- name: Run pytest -v
run: |
. ./pytest-venv/bin/activate
pytest -v
# Cleanup cached paths
- run: tarantoolctl rocks remove cartridge
tests-ee:
if: |
github.event_name == 'push'
runs-on: ubuntu-18.04
strategy:
matrix:
sdk-version: [
"2.10.1-0-g88b6f502c-r498-nogc64-linux-x86_64",
"2.11.0-entrypoint-6-g2b6d21d3b-r496-nogc64-linux-x86_64"
]
fail-fast: false
steps:
- uses: actions/setup-python@v2
with:
python-version: '3.9.8'
- uses: actions/checkout@v2
- name: Cache Tarantool SDK
id: cache-sdk
uses: actions/cache@v2
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-bundle-${{ matrix.sdk-version }}.tar.gz
curl -O -L \
https://tarantool:${{ secrets.CARTRIDGE_SDK_DOWNLOAD_TOKEN }}@download.tarantool.io/enterprise/${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)"
echo "${SDK_PATH}" >> ${GITHUB_PATH}
echo "TARANTOOL_SDK_PATH=${SDK_PATH}" >> ${GITHUB_ENV}
# Setup etcd
- name: Install etcd
uses: ./.github/actions/setup-etcd
if: runner.os == 'Linux'
with:
etcd-version: v2.3.8
install-prefix: etcd-v2.3.8
# Setup luatest
-
run: tarantoolctl rocks install luatest 0.5.7
# Setup pytest
- name: Cache pytest
uses: actions/cache@v2
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'
- run: tarantoolctl rocks make
- run: .rocks/bin/luatest -v
- name: Run pytest -v
run: |
. ./pytest-venv/bin/activate
pytest -v
# Cleanup cached paths
- run: tarantoolctl rocks remove cartridge