forked from manticoresoftware/manticoresearch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
executable file
·268 lines (240 loc) · 6.63 KB
/
.gitlab-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
workflow:
rules:
- if: $CI_MERGE_REQUEST_ID
- if: $CI_COMMIT_TAG
- if: $CI_COMMIT_BRANCH == "master"
- if: $CI_COMMIT_BRANCH =~ /^manticore-.*$/
- if: $CI_COMMIT_BRANCH == "maintenance-release"
# to skip ci add [ci skip] or [skip ci] in commit message in any capitalization,
# or add param when pushing, as: git push -o ci.skip ...
variables:
VERBOSE: 1
stages:
- mirroring
- routines
- ubertests
- publish
- hooks
# ==================== Mirror repo to github (only 'master' branch) ======================
job_mirror:
stage: mirroring
needs: [ ]
rules:
- if: $CI_COMMIT_BRANCH == "master"
- if: $CI_COMMIT_BRANCH =~ /^manticore-.*$/
- if: $CI_COMMIT_BRANCH == "maintenance-release"
tags:
- dev-host
script:
- rm -fr gitlab_github_sync
- git clone [email protected]:manticoresearch/dev.git gitlab_github_sync
- cd gitlab_github_sync
- git checkout $CI_COMMIT_BRANCH
- git remote add github [email protected]:manticoresoftware/manticoresearch.git
- git fetch github
- git push -u github $CI_COMMIT_BRANCH
cache: {}
# ==================== .helper build ======================
.build:
stage: routines
interruptible: true
needs: [ ]
tags:
- docker-free
image: manticoresearch/external_toolchain:clang15_cmake3263
variables:
CACHEB: "../cache"
DIAGNOSTIC: 1 # let's set it by default forever
NO_TESTS: 1
CTEST_CMAKE_GENERATOR: Ninja
CTEST_CONFIGURATION_TYPE: RelWithDebInfo # most common default
DISTR: bionic # our default build for tests
arch: x86_64
boost: boost_nov22
sysroot: roots_nov22
script:
- ctest -VV -S misc/ctest/gltest.cmake --no-compress-output
- exit_code=$?
- if [ $exit_code -ne 0 ]; then echo "Previous command failed"; fi;
- echo -e "\e[0Ksection_start:`date +%s`:xml_pack\r\e[0KCopy xml artifacts"
- cd build && mkdir xml
- cp -r Testing/2*/*.xml xml
- echo -e "\e[0Ksection_end:`date +%s`:xml_pack\r\e[0K"
cache:
paths:
- cache
key: bionic_test
artifacts:
when: on_success
expire_in: 12 hrs
paths:
- build/xml
- build/CMakeFiles/CMake*.log
- build/api/libsphinxclient/testcli
- build/src/indexer
- build/src/indextool
- build/src/searchd
- build/src/tests
- build/src/gtests/gmanticoretest
- build/config/*.c
- build/config/*.h
- build/**/*.gcno
# ==================== .helper testing ======================
.tests:
stage: ubertests
needs: [ ]
tags:
- specdocker
image: manticoresearch/ubertests_ctest:3263
variables:
DIAGNOSTIC: 1 # let's set it by default forever
CACHEB: "../cache"
script:
- ctest -V -S misc/ctest/gltest.cmake --no-compress-output
after_script:
- cd build
- cp -r Testing/2*/Test.xml .
- xsltproc -o junit_tests.xml ../misc/junit/ctest2junit.xsl Test.xml
cache:
key: bionic_test
paths:
- cache
artifacts:
expire_in: 12 hrs
when: always
reports:
junit: build/junit_tests.xml
paths:
- build/junit_tests.xml
- build/test/test_*/report.*
- build/test/error*.txt
- build/test/searchd.log
retry: 1
# ==================== Simple build, then test ======================
simple_build:
extends: [ .build ]
variables:
CTEST_CMAKE_GENERATOR: "Unix Makefiles" # as Ninja fails with coverage
CTEST_CONFIGURATION_TYPE: "Debug"
WITH_COVERAGE: 1
simple_tests:
extends: [ .tests ]
needs: [ simple_build ]
variables:
CTEST_CONFIGURATION_TYPE: "Debug"
WITH_COVERAGE: 1
NO_BUILD: 1
# ==================== Release build, then test ======================
release_build:
extends: [ .build ]
release_tests:
extends: [ .tests ]
needs: [ release_build ]
variables:
CTEST_CONFIGURATION_TYPE: "RelWithDebInfo"
NO_BUILD: 1
# ==================== Windows build, then test ======================
win_build:
extends: [ .build ]
variables:
DISTR: windows
arch: x64
sysroot: roots_apr12
CTEST_CMAKE_GENERATOR: "Ninja Multi-Config"
CTEST_CONFIGURATION_TYPE: Debug
artifacts:
paths:
- build/xml
- build/src/$CTEST_CONFIGURATION_TYPE/indexer.exe
- build/src/$CTEST_CONFIGURATION_TYPE/searchd.exe
- build/src/$CTEST_CONFIGURATION_TYPE/tests.exe
- build/src/gtests/$CTEST_CONFIGURATION_TYPE/gmanticoretest.exe
- build/usr
# Commented out usually need, but not on our dev where everything is installed into system
# - build/src/$CTEST_CONFIGURATION_TYPE/*.dll
# - build/src/gtests/$CTEST_CONFIGURATION_TYPE/*.dll
cache:
key: win_test
win_tests:
stage: ubertests
needs: [ win_build ]
tags:
- windev19
variables:
LIBS_BUNDLE: "x:/bundle"
CACHEB: "x:/cache"
BOOST_ROOT: "x:/boost_1_75_0"
CTEST_CMAKE_GENERATOR: "Visual Studio 16 2019"
CTEST_CONFIGURATION_TYPE: Debug
NO_BUILD: 1
script:
- 'net use x: \\\\VBOXSRV\\shared'
- ctest -V -S misc/ctest/gltest.cmake --no-compress-output
after_script:
- cd build
- cp -r Testing/2*/*.xml xml
artifacts:
expire_in: 12 hrs
when: always
paths:
- build/xml
- build/test/test_*/report.*
- build/test/error*.txt
- build/test/searchd.log
cache: { }
# ==================== Just build arm64 ======================
build_arm:
extends: [ .build ]
variables:
arch: aarch64
script:
- mkdir build && cd build
- ctest -VV -S ../misc/ctest/justbuild.cmake -DCTEST_SOURCE_DIRECTORY=.. --no-compress-output
cache:
key: $DISTR$arch
# ==================== Just build FreeBSD 13 ======================
build_bsd:
extends: [ .build ]
variables:
DISTR: freebsd13
boost: none
script:
- mkdir build && cd build
- ctest -VV -S ../misc/ctest/justbuild.cmake -DCTEST_SOURCE_DIRECTORY=.. --no-compress-output
cache:
key: $DISTR$arch
# ==================== Publish (push) pipeline results ======================
# build and upload on regular commits
convert_win_junit:
stage: publish
tags:
- docker
image: manticoresearch/ubertests_ctest:3263
needs:
- win_tests
variables:
GIT_STRATEGY: fetch
script:
- xsltproc -o build/junit_tests.xml misc/junit/ctest2junit.xsl build/xml/Test.xml
artifacts:
paths:
- build/junit_tests.xml
reports:
junit: build/junit_tests.xml
cache: {}
# ==================== Run secondary pipeline ======================
deploy_hook:
stage: hooks
trigger:
include: dist/gitlab-release.yml
forward:
pipeline_variables: true
needs:
- job: simple_tests
artifacts: false
- job: win_tests
artifacts: false
- job: release_tests
artifacts: false
- job: build_arm
artifacts: false