This repository has been archived by the owner on May 28, 2024. It is now read-only.
forked from greenplum-db/gpdb-archive
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
312 lines (298 loc) · 9.99 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
## ----------------------------------------------------------------------
## Travis CI build script for Greenplum Database Open Source Project.
## ----------------------------------------------------------------------
language: cpp
cache: ccache
git:
submodules: true
addons:
apt:
config:
retries: true
packages: &common_packages
- libxml2
- libxml2-dev
- libxerces-c-dev
- libevent-dev
- libperl-dev
- libuv1-dev
- python3
- python3-dev
- libapr1-dev
- libzstd1
- libzstd1-dev
- net-tools
- ssh
matrix:
allow_failures:
- arch: arm64
fast_finish: true
include:
# OS and Compiler variations
#
# NOTE: Some of the docker containers set LC_ALL and LC_CTYPE to
# values that are not specified on the system's locale as found
# via "locale -a". This causes gpinitsystem and possibly initdb
# to fail. Set these environment variables to the system's locale.
# ----------------------------------------------------------------
#
# Ubuntu Bionic, gcc 7
- os: linux
dist: bionic
compiler: gcc
env:
- T=debug C=""
- LC_CTYPE="en_US.utf8" LC_ALL="en_US.utf8" # see NOTE above
# Ubuntu Bionic, clang 7
- os: linux
dist: bionic
compiler: clang
env:
- T=debug C=""
- LC_CTYPE="en_US.utf8" LC_ALL="en_US.utf8" # see NOTE above
# macOS, XCode11
- os: osx
compiler: clang
osx_image: xcode11
env: T=macos
addons:
homebrew:
packages:
- ccache
- xerces-c
#
# Configuration variations
# ----------------------------------------------------------------
#
# Debug build without any compression algorithms supplied
- os: linux
dist: bionic
compiler: gcc
env:
- T=debug C="--without-zlib --without-libbz2 --without-zstd --without-quicklz"
- LC_CTYPE="en_US.utf8" LC_ALL="en_US.utf8" # see NOTE above
# ARM64, Ubuntu Bionic, gcc 7, unit tests
# For arm64, disable orca to avoid job timeouts
- os: linux
arch: arm64
dist: bionic
compiler: gcc
env:
- tests=unit T=debug C="--disable-orca"
- LC_CTYPE="en_US.utf8" LC_ALL="en_US.utf8" # see NOTE above
# ARM64, Ubuntu Bionic, gcc 7, installcheck
- os: linux
arch: arm64
dist: bionic
compiler: gcc
env:
- tests=installcheck T=debug C="--disable-orca"
- LC_CTYPE="en_US.utf8" LC_ALL="en_US.utf8" # see NOTE above
- name: clang-tidy
os: linux
dist: focal
addons:
apt:
packages:
- bear
- ninja-build
- clang-11
- clang-tidy-11
- parallel
- libxerces-c-dev
before_install: ~
install: ~
before_script: ~
after_script: ~
script:
- |
(
set -e
mkdir ../vpath.debug
cd ../vpath.debug
../gpdb/configure \
--enable-debug \
--enable-cassert \
--enable-orca \
--without-zstd --disable-gpfdist \
CC="ccache clang-11" CXX="ccache clang++-11" CFLAGS=-O0 CXXFLAGS=-O0
bear --append make -s -C src/backend/gpopt
)
CLANG_TIDY=clang-tidy-11 src/tools/tidy chk-gpopt ../vpath.debug
- |
(
set -e
mkdir ../vpath.release
cd ../vpath.release
../gpdb/configure \
--enable-debug \
--disable-cassert \
--enable-orca \
--without-zstd --disable-gpfdist \
CC="ccache clang-11" CXX="ccache clang++-11" CFLAGS=-O0 CXXFLAGS=-O0
bear --append make -s -C src/backend/gpopt
)
CLANG_TIDY=clang-tidy-11 src/tools/tidy chk-gpopt ../vpath.release
- CXX=clang++-11 cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -GNinja -DCMAKE_BUILD_TYPE=Debug -Hsrc/backend/gporca -Bbuild.debug
- CLANG_TIDY=clang-tidy-11 src/tools/tidy chk-orca build.debug
- CXX=clang++-11 cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -Hsrc/backend/gporca -Bbuild.relwithdebinfo
- CLANG_TIDY=clang-tidy-11 src/tools/tidy chk-orca build.relwithdebinfo
- name: check-format
stage: lint
os: linux
dist: focal
addons:
apt:
packages:
- clang-format-11
- parallel
before_install: ~
install: ~
before_script: ~
after_script: ~
script:
- env CLANG_FORMAT=clang-format-11 src/tools/fmt gen
- git diff --exit-code
- env CLANG_FORMAT=clang-format-11 src/tools/fmt chk
stages:
- lint
- test
## ----------------------------------------------------------------------
## Build tools
## ----------------------------------------------------------------------
# For linux, to prevent a possible crash in gpstop, disable RemoveIPC. See:
# https://www.postgresql.org/docs/current/kernel-resources.html#SYSTEMD-REMOVEIPC
before_install:
- eval "${OVERRIDE_CC}"
- eval "${OVERRIDE_CXX}"
- ccache --max-size 4G
# ccache 3.2 (from Ubuntu Xenial) has CCACHE_CPP2 default to off (this
# setting defaults to on starting from ccache 3.3). That default leads to
# unlegible compiler warning outputs because GCC and Clang will emit
# warnings using the preprocessed output...
- |
if [ "${TRAVIS_DIST}" = xenial ]; then
ccache --set-config run_second_cpp=true
fi
- |
if [ "${TRAVIS_COMPILER}" = clang ]; then
case "${TRAVIS_OS_NAME}" in
linux)
sudo ln -sv ../../bin/ccache /usr/lib/ccache/${CC}
sudo ln -sv ../../bin/ccache /usr/lib/ccache/${CXX}
;;
osx)
PATH=/usr/local/opt/ccache/libexec:$PATH
;;
esac
fi
if [ "${TRAVIS_OS_NAME}" = linux ]; then
echo "RemoveIPC=no" | sudo tee -a /etc/systemd/logind.conf
sudo systemctl daemon-reload
sudo systemctl restart systemd-logind
fi
## ----------------------------------------------------------------------
## Perform build:
## ----------------------------------------------------------------------
before_script:
- ssh-keygen -t "rsa" -f ~/.ssh/id_rsa -N ""
- ssh-keyscan $(hostname) >> ~/.ssh/known_hosts
- cp ~/.ssh/{id_rsa.pub,authorized_keys}
- ccache --zero-stats
script:
- |
set -eo pipefail
if [ "$T" = "debug" ]; then
./configure \
--prefix=${TRAVIS_BUILD_DIR}/gpsql \
--enable-cassert \
--enable-debug \
--enable-debug-extensions \
--with-perl \
--with-python \
--enable-orca \
--with-openssl \
--with-ldap \
--with-libcurl \
--with-libxml \
--enable-mapreduce \
--enable-orafce \
--enable-ic-proxy \
$C
travis_wait 50 make -s
make -s install
source ${TRAVIS_BUILD_DIR}/gpsql/greenplum_path.sh
if [ -z "$tests" ] || [ "$tests" = "unit" ]; then
make -s unittest-check
fi
if [ -z "$tests" ] || [ "$tests" = "installcheck" ]; then
make -C gpAux/gpdemo cluster
source gpAux/gpdemo/gpdemo-env.sh
trap look4diffs ERR
function look4diffs() {
echo ========regression.diffs========
cat src/test/regress/regression.diffs
echo ========regression.diffs========
exit 1
}
make -C src/test/regress installcheck-small
fi
fi
- |
set -eo pipefail
if [ "$T" = "production" ]; then
./configure \
--prefix=${TRAVIS_BUILD_DIR}/gpsql \
--with-perl \
--with-python \
--enable-orca \
--with-openssl \
--with-ldap \
--with-libcurl \
--with-libxml \
--enable-mapreduce \
--enable-orafce \
--enable-ic-proxy \
$C
travis_wait 50 make -s
make -s install
source ${TRAVIS_BUILD_DIR}/gpsql/greenplum_path.sh
make -s unittest-check
make -C gpAux/gpdemo cluster
source gpAux/gpdemo/gpdemo-env.sh
trap look4diffs ERR
function look4diffs() {
echo ========regression.diffs========
cat src/test/regress/regression.diffs
echo ========regression.diffs========
exit 1
}
make -C src/test/regress installcheck-small
fi
- |
set -eo pipefail
if [ "$T" = "macos" ]; then
./configure \
--prefix=${TRAVIS_BUILD_DIR}/gpsql \
--with-perl \
--with-python \
--enable-orca \
--enable-orafce \
--disable-gpfdist \
--disable-pxf \
--disable-gpcloud \
--without-zstd \
--with-includes=$(brew --prefix xerces-c)/include \
--with-libs=$(brew --prefix xerces-c)/lib \
CFLAGS='-O0' CXXFLAGS='-O0' \
$C
travis_wait 40 make -s
make -s install
source ${TRAVIS_BUILD_DIR}/gpsql/greenplum_path.sh
make -s unittest-check
fi
after_script:
- ccache --show-stats
- source ${TRAVIS_BUILD_DIR}/gpsql/greenplum_path.sh
- postgres --version
- gpssh --version