-
Notifications
You must be signed in to change notification settings - Fork 18
231 lines (189 loc) · 6.26 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
---
name: Tests
on:
push:
pull_request:
env:
GO_VERSION: '1.20.5'
PYTHON_VERSION: '3.x'
jobs:
tests-ce:
if: |
github.event_name == 'push' ||
github.event_name == 'pull_request' && github.event.pull_request.head.repo.owner.login != 'tarantool'
runs-on: ubuntu-20.04
strategy:
matrix:
tarantool-version: ["1.10", "2.8", "2.x-latest"]
tests: ["other", "integration"]
fail-fast: false
steps:
- uses: actions/checkout@master
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: Setup Mage
run: |
git clone https://github.com/magefile/mage
cd mage
go run bootstrap.go
- name: Install build requirements
run: |
sudo apt -y update
sudo apt -y install git gcc make cmake unzip
git config --global user.email "test@tarantool.io"
git config --global user.name "Tar Antool"
- name: Install Tarantool
if: matrix.tarantool-version != '2.x-latest'
uses: tarantool/setup-tarantool@v1
with:
tarantool-version: '${{ matrix.tarantool-version }}'
- name: Install latest pre-release Tarantool 2.x
if: matrix.tarantool-version == '2.x-latest'
run: |
curl -L https://tarantool.io/pre-release/2/installer.sh | bash
sudo apt-get -y install tarantool
- name: Cache docker images
uses: satackey/action-docker-layer-caching@v0.0.11
continue-on-error: true
with:
key: ${{ runner.os }}-docker-layer-cache-${{ matrix.tarantool-version }}
restore-keys: |
${{ runner.os }}-docker-layer-cache-
- name: Stop and disable Taranool 1.10 example service
if: matrix.tarantool-version == '1.10'
run: |
sudo systemctl stop tarantool@example || true
sudo systemctl disable tarantool@example || true
sudo rm -rf /lib/systemd/system/tarantool@.service
# This server starts and listen on 8084 port that is used for tests
- name: Stop Mono server
run: sudo kill -9 $(sudo lsof -t -i tcp:8084) || true
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: '${{ env.PYTHON_VERSION }}'
- name: Install tests requirements
run: |
pip3 install -r test/requirements.txt
tarantoolctl rocks install luacheck
- name: Log versions
run: |
go version
mage --version
tarantool --version
rpm --version
- name: Stop and disable mono-xsp4 service
run: |
sudo systemctl stop mono-xsp4.service || true
sudo systemctl disable mono-xsp4.service || true
- name: Linter
if: matrix.tests == 'other'
run: mage lint
- name: Build cartridge
run: mage build
- name: License checker
run: |
go install github.com/uw-labs/lichen@latest
mage checklicenses
- name: Unit tests
if: matrix.tests == 'other'
run: mage unit
- name: Integration tests
if: matrix.tests == 'integration'
run: mage integration
- name: Examples tests
if: matrix.tests == 'other'
run: mage testExamples
- name: e2e tests
if: matrix.tests == 'other'
run: mage e2e
tests-ee:
if: |
github.event_name == 'push'
runs-on: ubuntu-20.04
strategy:
matrix:
tests: ["other", "integration"]
sdk-version: ["2.8.2-0-gfc96d10f5-r421"]
fail-fast: false
steps:
- uses: actions/checkout@master
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: Setup Mage
run: |
git clone https://github.com/magefile/mage
cd mage
go run bootstrap.go
- name: Install build requirements
run: |
sudo apt -y update
sudo apt -y install git gcc make cmake unzip
git config --global user.email "test@tarantool.io"
git config --global user.name "Tar Antool"
- name: Cache Tarantool SDK
id: cache-sdk
uses: actions/cache@v3
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.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}
# This server starts and listen on 8084 port that is used for tests
- name: Stop Mono server
run: sudo kill -9 $(sudo lsof -t -i tcp:8084) || true
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install tests requirements
run: |
pip3 install -r test/requirements.txt
tarantoolctl rocks install luacheck
- name: Log versions
run: |
go version
mage --version
tarantool --version
rpm --version
- name: Linter
if: matrix.tests == 'other'
run: mage lint
- name: Build cartridge
run: mage build
- name: License checker
run: |
go install github.com/uw-labs/lichen@latest
mage checklicenses
- name: Unit tests
if: matrix.tests == 'other'
run: mage unit
- name: Integration tests
if: matrix.tests == 'integration'
run: mage integration
- name: Examples tests
if: matrix.tests == 'other'
run: mage testExamples
- name: e2e tests
if: matrix.tests == 'other'
run: mage e2e