-
Notifications
You must be signed in to change notification settings - Fork 88
/
.travis.yml
525 lines (485 loc) · 16.3 KB
/
.travis.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
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
language: cpp
git:
clone: true
submodules: true
depth: 1
quiet: false
env:
global:
- SOURCE_DIR=$TRAVIS_BUILD_DIR
- BUILD_DIR=$SOURCE_DIR/build
- INSTALL_DIR=$SOURCE_DIR/build/prefix
- PACKAGE_DIR=$SOURCE_DIR/build/package
- RUN_DIR=$SOURCE_DIR/build/run
- CTEST_EXTRA_ARGS=--output-on-failure
jobs:
include:
- name: "Ubuntu 18.04 - UnixODBC - Debug - x86_64 - GCC (system) - Unix Makefiles"
os: linux
dist: bionic
compiler: gcc
env:
- CC=gcc
- CXX=g++
- ODBC_PROVIDER=UnixODBC
- BUILD_TYPE=Debug
- EXTERNAL_THIRD_PARTY=no
- PACKAGING=yes
- TESTING=yes
- STANDALONE_TESTS_ONLY=no
- CLICKHOUSE_SERVER_IMAGE="clickhouse/clickhouse-server:23.1"
services:
- docker
addons:
apt:
sources:
- sourceline: 'deb https://apt.kitware.com/ubuntu/ bionic main'
key_url: 'https://apt.kitware.com/keys/kitware-archive-latest.asc'
packages:
- gcc
- g++
- libicu-dev
- unixodbc
- unixodbc-bin
- unixodbc-dev
- name: "Ubuntu 18.04 - UnixODBC - Release - x86_64 - GCC (system) - Unix Makefiles"
os: linux
dist: bionic
compiler: gcc
env:
- CC=gcc
- CXX=g++
- ODBC_PROVIDER=UnixODBC
- BUILD_TYPE=Release
- EXTERNAL_THIRD_PARTY=no
- PACKAGING=yes
- TESTING=yes
- STANDALONE_TESTS_ONLY=no
- CLICKHOUSE_SERVER_IMAGE="clickhouse/clickhouse-server:23.1"
services:
- docker
addons:
apt:
sources:
- sourceline: 'deb https://apt.kitware.com/ubuntu/ bionic main'
key_url: 'https://apt.kitware.com/keys/kitware-archive-latest.asc'
packages:
- gcc
- g++
- libicu-dev
- unixodbc
- unixodbc-bin
- unixodbc-dev
- name: "Ubuntu 18.04 - UnixODBC - RelWithDebInfo - x86_64 - GCC (system) - Unix Makefiles"
os: linux
dist: bionic
compiler: gcc
env:
- CC=gcc
- CXX=g++
- ODBC_PROVIDER=UnixODBC
- BUILD_TYPE=RelWithDebInfo
- EXTERNAL_THIRD_PARTY=no
- PACKAGING=yes
- TESTING=yes
- STANDALONE_TESTS_ONLY=no
- CLICKHOUSE_SERVER_IMAGE="clickhouse/clickhouse-server:23.1"
services:
- docker
addons:
apt:
sources:
- sourceline: 'deb https://apt.kitware.com/ubuntu/ bionic main'
key_url: 'https://apt.kitware.com/keys/kitware-archive-latest.asc'
packages:
- gcc
- g++
- libicu-dev
- unixodbc
- unixodbc-bin
- unixodbc-dev
- name: "Ubuntu 18.04 - UnixODBC - RelWithDebInfo - System third-party libs - x86_64 - GCC (system) - Unix Makefiles"
os: linux
dist: bionic
compiler: gcc
env:
- CC=gcc
- CXX=g++
- ODBC_PROVIDER=UnixODBC
- BUILD_TYPE=RelWithDebInfo
- EXTERNAL_THIRD_PARTY=yes
- PACKAGING=yes
- TESTING=yes
- STANDALONE_TESTS_ONLY=no
- CLICKHOUSE_SERVER_IMAGE="clickhouse/clickhouse-server:23.1"
services:
- docker
addons:
apt:
sources:
- sourceline: 'deb https://apt.kitware.com/ubuntu/ bionic main'
key_url: 'https://apt.kitware.com/keys/kitware-archive-latest.asc'
packages:
- gcc
- g++
- openssl
- libssl-dev
- libpoco-dev
- libicu-dev
- googletest
- unixodbc
- unixodbc-bin
- unixodbc-dev
- name: "Ubuntu 18.04 - UnixODBC - RelWithDebInfo - x86_64 - Clang (default) - Unix Makefiles"
os: linux
dist: bionic
compiler: clang
env:
- CC=clang
- CXX=clang++
- ODBC_PROVIDER=UnixODBC
- BUILD_TYPE=RelWithDebInfo
- EXTERNAL_THIRD_PARTY=no
- PACKAGING=yes
- TESTING=yes
- STANDALONE_TESTS_ONLY=no
- CLICKHOUSE_SERVER_IMAGE="clickhouse/clickhouse-server:23.1"
services:
- docker
addons:
apt:
sources:
- sourceline: 'deb https://apt.kitware.com/ubuntu/ bionic main'
key_url: 'https://apt.kitware.com/keys/kitware-archive-latest.asc'
packages:
- clang
- libicu-dev
- unixodbc
- unixodbc-bin
- unixodbc-dev
- name: "Ubuntu 18.04 - iODBC - RelWithDebInfo - x86_64 - GCC (system) - Unix Makefiles"
os: linux
dist: bionic
compiler: gcc
env:
- CC=gcc
- CXX=g++
- ODBC_PROVIDER=iODBC
- BUILD_TYPE=RelWithDebInfo
- EXTERNAL_THIRD_PARTY=no
- PACKAGING=yes
- TESTING=yes
- STANDALONE_TESTS_ONLY=no
- CLICKHOUSE_SERVER_IMAGE="clickhouse/clickhouse-server:23.1"
services:
- docker
addons:
apt:
sources:
- sourceline: 'deb https://apt.kitware.com/ubuntu/ bionic main'
key_url: 'https://apt.kitware.com/keys/kitware-archive-latest.asc'
packages:
- gcc
- g++
- libicu-dev
- iodbc
- libiodbc2
- libiodbc2-dev
- name: "Ubuntu 18.04 - iODBC - RelWithDebInfo - x86_64 - Clang (default) - Unix Makefiles"
os: linux
dist: bionic
compiler: clang
env:
- CC=clang
- CXX=clang++
- ODBC_PROVIDER=iODBC
- BUILD_TYPE=RelWithDebInfo
- EXTERNAL_THIRD_PARTY=no
- PACKAGING=yes
- TESTING=yes
- STANDALONE_TESTS_ONLY=no
- CLICKHOUSE_SERVER_IMAGE="clickhouse/clickhouse-server:23.1"
services:
- docker
addons:
apt:
sources:
- sourceline: 'deb https://apt.kitware.com/ubuntu/ bionic main'
key_url: 'https://apt.kitware.com/keys/kitware-archive-latest.asc'
packages:
- clang
- libicu-dev
- iodbc
- libiodbc2
- libiodbc2-dev
- name: "Windows Server 1803 - MDAC - RelWithDebInfo - x64 - MSVC (Visual Studio 2017) - MSBuild"
os: windows
language: shell
env:
- ODBC_PROVIDER=MDAC
- BUILD_TYPE=RelWithDebInfo
- EXTERNAL_THIRD_PARTY=no
- PACKAGING=yes
- TESTING=yes
- STANDALONE_TESTS_ONLY=yes
- CMAKE_CONFIGURE_EXTRA_ARGS="-A x64 -DCMAKE_SYSTEM_VERSION=10.0.18362.0 $CMAKE_CONFIGURE_EXTRA_ARGS"
- VCVARSALL_ARGS=x64
- name: "Windows Server 1803 - MDAC - RelWithDebInfo - x86 - MSVC (Visual Studio 2017) - MSBuild"
os: windows
language: shell
env:
- ODBC_PROVIDER=MDAC
- BUILD_TYPE=RelWithDebInfo
- EXTERNAL_THIRD_PARTY=no
- PACKAGING=yes
- TESTING=yes
- STANDALONE_TESTS_ONLY=yes
- CMAKE_CONFIGURE_EXTRA_ARGS="-A Win32 -DCMAKE_SYSTEM_VERSION=10.0.18362.0 $CMAKE_CONFIGURE_EXTRA_ARGS"
- VCVARSALL_ARGS=x86
- name: "macOS 10.14 - iODBC - RelWithDebInfo - x86_64 - AppleClang (Xcode 11.2) - Unix Makefiles"
os: osx
osx_image: xcode11.2
compiler: clang
env:
- ODBC_PROVIDER=iODBC
- BUILD_TYPE=RelWithDebInfo
- EXTERNAL_THIRD_PARTY=no
- PACKAGING=yes
- TESTING=yes
- STANDALONE_TESTS_ONLY=no
addons:
homebrew:
packages:
- icu4c
- libiodbc
update: true
- name: "macOS 10.14 - iODBC - RelWithDebInfo - System third-party libs - x86_64 - AppleClang (Xcode 11.2) - Unix Makefiles"
os: osx
osx_image: xcode11.2
compiler: clang
env:
- ODBC_PROVIDER=iODBC
- BUILD_TYPE=RelWithDebInfo
- EXTERNAL_THIRD_PARTY=yes
- PACKAGING=yes
- TESTING=yes
- STANDALONE_TESTS_ONLY=no
addons:
homebrew:
packages:
- openssl
- poco
- icu4c
- libiodbc
update: true
- name: "macOS 10.14 - UnixODBC - RelWithDebInfo - x86_64 - AppleClang (Xcode 11.2) - Unix Makefiles"
os: osx
osx_image: xcode11.2
compiler: clang
env:
- ODBC_PROVIDER=UnixODBC
- BUILD_TYPE=RelWithDebInfo
- EXTERNAL_THIRD_PARTY=no
- PACKAGING=yes
- TESTING=yes
- STANDALONE_TESTS_ONLY=no
addons:
homebrew:
packages:
- icu4c
- unixodbc
update: true
before_install: |-
set -Eeo pipefail
unalias cd || true
unset -f cd || true
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
sudo apt-get update -q
elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
cd "$(brew --repo)" && git fetch && git reset --hard origin/master && cd -
brew update
elif [[ "$TRAVIS_OS_NAME" == "windows" ]]; then
: # choco upgrade
fi
install: |-
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
export PATH=$(echo "$PATH" | sed -e 's|:/usr/local/cmake-[^:]*/bin:|:|')
sudo apt-get install -y build-essential cmake perl libdbi-perl libdbd-odbc-perl python python-pip python-pyodbc python3 python3-pip python3-pyodbc python3-setuptools
pip3 install --user 'testflows==1.6.56'
elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
# brew install cmake perl python
PERL_MM_USE_DEFAULT=1 cpan -T DBD::ODBC
if [[ "$ODBC_PROVIDER" == "UnixODBC" ]]; then
pip2 install --user pyodbc
pip3 install --user pyodbc 'testflows==1.6.56'
fi
elif [[ "$TRAVIS_OS_NAME" == "windows" ]]; then
export OLD_VSWHERE=yes
# TODO: use choco instead of manual download/unpack/env setting, once 3.14+ version
# is available, since starting from 3.14 WiX Toolset doesn't depend on .NET 3.5,
# which has problems installing via choco.
# choco install wixtoolset --yes
wget https://wixtoolset.org/downloads/v3.14.0.712/wix314-binaries.zip
powershell -Command Expand-Archive wix314-binaries.zip -DestinationPath wix314-binaries
export WIX="$(cd wix314-binaries && pwd -W)"
fi
.clickhouse_start: &clickhouse_start |-
if [[ "$TESTING" == "yes" ]] && [[ "$STANDALONE_TESTS_ONLY" != "yes" ]]; then
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
docker pull ${CLICKHOUSE_SERVER_IMAGE}
CLICKHOUSE_SERVER_CONTAINER=$(docker run -d ${CLICKHOUSE_SERVER_IMAGE})
CLICKHOUSE_SERVER_IP=$(docker inspect -f '{{ .NetworkSettings.IPAddress }}' ${CLICKHOUSE_SERVER_CONTAINER})
docker ps -a
docker stats -a --no-stream
elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
# In macOS, ClickHouse is installed and running as a separate process on this same system.
# TODO: use native package manager when available.
$SOURCE_DIR/test/deploy_and_run_clickhouse_macos.sh
CLICKHOUSE_SERVER_IP=localhost
fi
fi
.odbc_configure: &odbc_configure |-
if [[ "$TESTING" == "yes" ]] && [[ "$STANDALONE_TESTS_ONLY" != "yes" ]]; then
if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then
: # TODO
else
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
ODBC_DRIVER_PATH=$BUILD_DIR/driver/libclickhouseodbc.so
ODBC_DRIVERW_PATH=$BUILD_DIR/driver/libclickhouseodbcw.so
elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
ODBC_DRIVER_PATH=$BUILD_DIR/driver/libclickhouseodbc.dylib
ODBC_DRIVERW_PATH=$BUILD_DIR/driver/libclickhouseodbcw.dylib
fi
export ODBCSYSINI=$RUN_DIR
export ODBCINSTINI=.odbcinst.ini
export ODBCINI=$ODBCSYSINI/.odbc.ini
if [[ "$ODBC_PROVIDER" == "iODBC" ]]; then
# Full path to a custom odbcinst.ini in ODBCINSTINI for iODBC.
export ODBCINSTINI=$ODBCSYSINI/$ODBCINSTINI
fi
cat > $ODBCSYSINI/.odbcinst.ini <<-EOF
[ODBC]
Trace = 1
TraceFile = ${RUN_DIR}/odbc-driver-manager-trace.log
Debug = 1
DebugFile = ${RUN_DIR}/odbc-driver-manager-debug.log
[ODBC Drivers]
ClickHouse ODBC Driver (ANSI) = Installed
ClickHouse ODBC Driver (Unicode) = Installed
[ClickHouse ODBC Driver (ANSI)]
Driver = ${ODBC_DRIVER_PATH}
Setup = ${ODBC_DRIVER_PATH}
UsageCount = 1
[ClickHouse ODBC Driver (Unicode)]
Driver = ${ODBC_DRIVERW_PATH}
Setup = ${ODBC_DRIVERW_PATH}
UsageCount = 1
EOF
cat > $ODBCSYSINI/.odbc.ini <<-EOF
[ODBC]
Trace = 1
TraceFile = ${RUN_DIR}/odbc-driver-manager-trace.log
Debug = 1
DebugFile = ${RUN_DIR}/odbc-driver-manager-debug.log
[ODBC Data Sources]
ClickHouse DSN (ANSI) = ClickHouse ODBC Driver (ANSI)
ClickHouse DSN (Unicode) = ClickHouse ODBC Driver (Unicode)
ClickHouse DSN (ANSI, RBWNAT) = ClickHouse ODBC Driver (ANSI)
[ClickHouse DSN (ANSI)]
Driver = ClickHouse ODBC Driver (ANSI)
Description = Test DSN for ClickHouse ODBC Driver (ANSI)
Url = http://${CLICKHOUSE_SERVER_IP}
DriverLog = yes
DriverLogFile = ${RUN_DIR}/clickhouse-odbc-driver.log
[ClickHouse DSN (Unicode)]
Driver = ClickHouse ODBC Driver (Unicode)
Description = Test DSN for ClickHouse ODBC Driver (Unicode)
Url = http://${CLICKHOUSE_SERVER_IP}
DriverLog = yes
DriverLogFile = ${RUN_DIR}/clickhouse-odbc-driver-w.log
[ClickHouse DSN (ANSI, RBWNAT)]
Driver = ClickHouse ODBC Driver (ANSI)
Description = Test DSN for ClickHouse ODBC Driver (ANSI) that uses RowBinaryWithNamesAndTypes as data source communication default format
Url = http://${CLICKHOUSE_SERVER_IP}/query?default_format=RowBinaryWithNamesAndTypes
DriverLog = yes
DriverLogFile = ${RUN_DIR}/clickhouse-odbc-driver.log
EOF
fi
fi
.configure: &configure |-
CMAKE_CONFIGURE_ARGS="-DTEST_DSN_LIST=\"ClickHouse DSN (ANSI);ClickHouse DSN (Unicode);ClickHouse DSN (ANSI, RBWNAT)\" $CMAKE_CONFIGURE_EXTRA_ARGS"
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
CMAKE_CONFIGURE_ARGS="-DICU_ROOT=$(brew --prefix)/opt/icu4c $CMAKE_CONFIGURE_ARGS"
fi
if [[ "$EXTERNAL_THIRD_PARTY" == "yes" ]]; then
CMAKE_CONFIGURE_ARGS="-DCH_ODBC_PREFER_BUNDLED_THIRD_PARTIES=OFF $CMAKE_CONFIGURE_ARGS"
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
CMAKE_CONFIGURE_ARGS="-DOPENSSL_ROOT_DIR=$(brew --prefix)/opt/openssl $CMAKE_CONFIGURE_ARGS"
fi
fi
if [[ ! -z "$ODBC_PROVIDER" ]]; then
CMAKE_CONFIGURE_ARGS="-DODBC_PROVIDER=$ODBC_PROVIDER $CMAKE_CONFIGURE_ARGS"
fi
cd $BUILD_DIR
echo "#!/usr/bin/env bash" > cmake_configure.sh
echo "set -Eeuo pipefail" >> cmake_configure.sh
echo "cmake $CMAKE_CONFIGURE_ARGS $SOURCE_DIR" >> cmake_configure.sh
chmod u+x cmake_configure.sh
if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then
$SOURCE_DIR/test/vcvars_enabled_bash.sh ./cmake_configure.sh
else
./cmake_configure.sh
fi
.build: &build |-
CMAKE_BUILD_ARGS="--config $BUILD_TYPE $CMAKE_BUILD_EXTRA_ARGS -- $CMAKE_BUILD_NATIVE_EXTRA_ARGS"
cd $BUILD_DIR
if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then
$SOURCE_DIR/test/vcvars_enabled_bash.sh cmake --build . $CMAKE_BUILD_ARGS
else
cmake --build . $CMAKE_BUILD_ARGS
fi
.pack: &pack |-
if [[ "$PACKAGING" == "yes" ]]; then
CPACK_ARGS="-C $BUILD_TYPE $CPACK_EXTRA_ARGS"
cd $BUILD_DIR
if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then
# 'cpack' is a chocolatey tool, so we use CMake's 'package' target instead
CPACK_ARGS="--build . --config $BUILD_TYPE --target package -- $CPACK_EXTRA_ARGS"
$SOURCE_DIR/test/vcvars_enabled_bash.sh cmake $CPACK_ARGS
else
cpack $CPACK_ARGS
fi
fi
.test: &test |-
if [[ "$TESTING" == "yes" ]]; then
CTEST_ARGS="-C $BUILD_TYPE $CTEST_EXTRA_ARGS"
if [[ "$STANDALONE_TESTS_ONLY" == "yes" ]]; then
CTEST_ARGS="-R '.*-ut.*' $CTEST_ARGS"
fi
cd $BUILD_DIR
if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then
$SOURCE_DIR/test/vcvars_enabled_bash.sh ctest $CTEST_ARGS
else
ctest $CTEST_ARGS
fi
fi
before_script: |-
mkdir -p $SOURCE_DIR
mkdir -p $BUILD_DIR
mkdir -p $INSTALL_DIR
mkdir -p $PACKAGE_DIR
mkdir -p $RUN_DIR
if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then
SOURCE_DIR="$(cd $SOURCE_DIR && pwd -W)"
BUILD_DIR="$(cd $BUILD_DIR && pwd -W)"
INSTALL_DIR="$(cd $INSTALL_DIR && pwd -W)"
PACKAGE_DIR="$(cd $PACKAGE_DIR && pwd -W)"
RUN_DIR="$(cd $RUN_DIR && pwd -W)"
fi
script:
- *clickhouse_start
- *odbc_configure
- *configure
- *build
- *pack
- *test