-
Notifications
You must be signed in to change notification settings - Fork 12
213 lines (180 loc) · 6.41 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
---
name: Tests
on:
push:
branches-ignore:
- 'master'
pull_request:
pull_request_target:
types: [labeled]
env:
# Note: Use exactly match version of tool, to avoid unexpected issues with test on CI.
GO_VERSION: '1.21.13'
PYTHON_VERSION: '3.10'
jobs:
tests-ce:
if: |
(github.event_name == 'push') ||
(github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.owner.login != 'tarantool' &&
!contains(github.event.pull_request.labels.*.name, 'full-ci'))
runs-on: ubuntu-22.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 unit
# 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 integration
tests-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
# Limiting the number of jobs for building Python-GRPCIO is a workaround for the
# Out Of Memory (OOM) killer on AArch64 runners.
GRPC_PYTHON_BUILD_EXT_COMPILER_JOBS=6 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
- name: Integration tests
run: mage integration
tests-ee:
# The same as for tests-ce, but it does not run on pull requests from
# forks by default. Tests will run only when the pull request is labeled
# with `ee-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.pull_request.head.repo.owner.login != 'tarantool' &&
!contains(github.event.pull_request.labels.*.name, 'full-ci') &&
github.event.label.name == 'ee-ci')
runs-on: ubuntu-22.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 unit
# 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 integration
tests-mac-os-ce:
if: |
(github.event_name == 'push') ||
(github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.owner.login != 'tarantool' &&
!contains(github.event.pull_request.labels.*.name, 'full-ci'))
runs-on: [self-hosted, macOS-13-self-hosted, x86_64, regular]
timeout-minutes: 40
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 node
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 -V 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
# Sometimes CI on macOS terminates with a “docker daemon not running” error.
# To prevent this we set the path to the docker socket directly.
- name: Prepare Docker
run: |
echo "DOCKER_HOST=unix:///${HOME}/.docker/run/docker.sock" >> $GITHUB_ENV
docker context use default
- name: Unit tests
run: mage unit
# We need to override TMPDIR here because of the very long path in macOS tests
# which causes a very long socket path error.
- name: Run integration tests
run: TMPDIR=/tmp mage integration
# 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