forked from percona/percona-server
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
295 lines (276 loc) · 11.8 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
# Ubuntu 14.04
dist: trusty
sudo: required
language: cpp
cache:
ccache: true
timeout: 600
directories:
- $TRAVIS_BUILD_DIR/deps # cache Boost libraries
env:
global:
- PARENT_BRANCH=5.7
- CCACHE_DIR=$HOME/.ccache
- CCACHE_COMPRESS=1
- CCACHE_COMPRESSLEVEL=9
- CCACHE_MAXSIZE=500Mi
- CCACHE_CPP2=1
matrix:
include:
# Common
- env: COMMAND=clang-test
script:
- wget https://llvm.org/svn/llvm-project/cfe/trunk/tools/clang-format/clang-format-diff.py
- chmod a+x clang-format-diff.py
- git diff -U0 --no-color HEAD^1 *.c *.cc *.cpp *.h *.hpp *.i *.ic *.ih | ./clang-format-diff.py -style=file -p1 >_GIT_DIFF
- '[ ! -s _GIT_DIFF ] && { echo The last git commit is clang-formatted; travis_terminate 0; } || { cat _GIT_DIFF; travis_terminate 1; }'
# Configurations for developers' forks and after merging a pull request for percona/percona-server
# 1
- if: repo != percona/percona-server OR repo = percona/percona-server AND type IN (push, cron)
env: BUILD=Debug
compiler: clang
os: osx
osx_image: xcode9.3
# 2
- if: repo != percona/percona-server OR repo = percona/percona-server AND type IN (push, cron)
env: VERSION=6.0 BUILD=RelWithDebInfo
compiler: clang
# 3
- if: repo != percona/percona-server OR repo = percona/percona-server AND type IN (push, cron)
env: VERSION=5.0 BUILD=Debug
compiler: clang
# 4
- if: repo != percona/percona-server OR repo = percona/percona-server AND type IN (push, cron)
env: VERSION=4.0 BUILD=Debug
compiler: clang
# 5
- if: repo != percona/percona-server OR repo = percona/percona-server AND type IN (push, cron)
env: VERSION=8 BUILD=Debug
compiler: gcc
# 6
- if: repo != percona/percona-server OR repo = percona/percona-server AND type IN (push, cron)
env: VERSION=7 BUILD=Debug
compiler: gcc
# 7
- if: repo != percona/percona-server OR repo = percona/percona-server AND type IN (push, cron)
env: VERSION=6 BUILD=Debug
compiler: gcc
# 8
- if: repo != percona/percona-server OR repo = percona/percona-server AND type IN (push, cron)
env: VERSION=5 BUILD=Debug
compiler: gcc
# 9
- if: repo != percona/percona-server OR repo = percona/percona-server AND type IN (push, cron)
env: VERSION=4.8 BUILD=Debug
compiler: gcc
# Configurations for a pull request and after merging for percona/percona-server
# 1
- if: branch =~ fullci OR repo = percona/percona-server AND type IN (push, pull_request, cron)
env: BUILD=RelWithDebInfo
compiler: clang
os: osx
osx_image: xcode9.3
# 2
- if: branch =~ fullci OR repo = percona/percona-server AND type IN (push, pull_request, cron)
env: VERSION=6.0 BUILD=Debug
compiler: clang
# 3
- if: branch =~ fullci OR repo = percona/percona-server AND type IN (push, pull_request, cron)
env: VERSION=5.0 BUILD=RelWithDebInfo
compiler: clang
# 4
- if: branch =~ fullci OR repo = percona/percona-server AND type IN (push, pull_request, cron)
env: VERSION=4.0 BUILD=RelWithDebInfo
compiler: clang
# 5
- if: branch =~ fullci OR repo = percona/percona-server AND type IN (push, pull_request, cron)
env: VERSION=8 BUILD=RelWithDebInfo
compiler: gcc
# 6
- if: branch =~ fullci OR repo = percona/percona-server AND type IN (push, pull_request, cron)
env: VERSION=7 BUILD=RelWithDebInfo
compiler: gcc
# 7
- if: branch =~ fullci OR repo = percona/percona-server AND type IN (push, pull_request, cron)
env: VERSION=6 BUILD=RelWithDebInfo
compiler: gcc
# 8
- if: branch =~ fullci OR repo = percona/percona-server AND type IN (push, pull_request, cron)
env: VERSION=5 BUILD=RelWithDebInfo
compiler: gcc
# 9
- if: branch =~ fullci OR repo = percona/percona-server AND type IN (push, pull_request, cron)
env: VERSION=4.8 BUILD=RelWithDebInfo
compiler: gcc
# Configurations to be run after merging a pull request for percona/percona-server
# 1
- if: branch =~ extraci OR repo = percona/percona-server AND type IN (push, cron)
env: VERSION=6.0 BUILD=RelWithDebInfo INVERTED=ON
compiler: clang
# 2
- if: branch =~ extraci OR repo = percona/percona-server AND type IN (push, cron)
env: VERSION=5.0 BUILD=RelWithDebInfo INVERTED=ON
compiler: clang
# 3
- if: branch =~ extraci OR repo = percona/percona-server AND type IN (push, cron)
env: VERSION=4.0 BUILD=RelWithDebInfo INVERTED=ON
compiler: clang
# 4
- if: branch =~ extraci OR repo = percona/percona-server AND type IN (push, cron)
env: VERSION=8 BUILD=RelWithDebInfo INVERTED=ON
compiler: gcc
# 5
- if: branch =~ extraci OR repo = percona/percona-server AND type IN (push, cron)
env: VERSION=7 BUILD=RelWithDebInfo INVERTED=ON
compiler: gcc
# 6
- if: branch =~ extraci OR repo = percona/percona-server AND type IN (push, cron)
env: VERSION=6 BUILD=RelWithDebInfo INVERTED=ON
compiler: gcc
# 7
- if: branch =~ extraci OR repo = percona/percona-server AND type IN (push, cron)
env: VERSION=5 BUILD=RelWithDebInfo INVERTED=ON
compiler: gcc
#8
- if: branch =~ extraci OR repo = percona/percona-server AND type IN (push, cron)
env: VERSION=4.8 BUILD=RelWithDebInfo INVERTED=ON
compiler: gcc
script:
- JOB_NUMBER=$(echo $TRAVIS_JOB_NUMBER | sed -e 's:[0-9][0-9]*\.\(.*\):\1:');
echo --- JOB_NUMBER=$JOB_NUMBER TRAVIS_COMMIT=$TRAVIS_COMMIT TRAVIS_COMMIT_RANGE=$TRAVIS_COMMIT_RANGE TRAVIS_REPO_SLUG=$TRAVIS_REPO_SLUG TRAVIS_BRANCH=$TRAVIS_BRANCH TRAVIS_EVENT_TYPE=$TRAVIS_EVENT_TYPE TRAVIS_PULL_REQUEST=$TRAVIS_PULL_REQUEST TRAVIS_PULL_REQUEST_BRANCH=$TRAVIS_PULL_REQUEST_BRANCH
- echo --- Perform all Travis jobs or only jobs that are included in ENV_VAR_JOB_NUMBERS list if it is defined;
JOB_NUMBERS="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";
if [[ "$ENV_VAR_JOB_NUMBERS" != "" ]]; then
JOB_NUMBERS=$ENV_VAR_JOB_NUMBERS;
fi;
JOB_ARRAY=(${JOB_NUMBERS// / });
if [[ ! " ${JOB_ARRAY[@]} " =~ " ${JOB_NUMBER} " ]]; then
echo --- Finishing as job ${JOB_NUMBER} is not on a list = $JOB_NUMBERS;
travis_terminate 0;
fi;
# For the trunk use TRAVIS_COMMIT_RANGE but "Auto cancel branch builds" has to be turned off at https://travis-ci.org/percona/percona-server/settings
# For pull requests and feature branches replace TRAVIS_COMMIT_RANGE with the range from the root to the tip of the branch
- if [[ "$TRAVIS_EVENT_TYPE" == "pull_request" ]] || [[ "$TRAVIS_REPO_SLUG" != "percona/percona-server" ]]; then
if [[ "$TRAVIS_EVENT_TYPE" == "pull_request" ]]; then TRAVIS_COMMIT=$TRAVIS_COMMIT^2; fi;
git fetch https://github.com/percona/percona-server.git $PARENT_BRANCH:master_repo_$PARENT_BRANCH;
PARENT_COMMIT=$(git rev-list --first-parent --topo-order $TRAVIS_COMMIT ^master_repo_$PARENT_BRANCH | tail -1);
TRAVIS_COMMIT_RANGE=$PARENT_COMMIT^..$TRAVIS_COMMIT;
fi;
if MODIFIED_FILES=$(git diff --name-only $TRAVIS_COMMIT_RANGE 2>/dev/null); then
echo -e "--- Modified files in $TRAVIS_COMMIT_RANGE:\n$MODIFIED_FILES";
if ! echo "$MODIFIED_FILES" | grep -qvE '^(doc|build-ps|mysql-test|packaging|policy|scripts|support-files)/'; then
echo "--- There are no code changes, stopping build process.";
travis_terminate 0;
else
echo "--- Code changes were found";
fi;
else
echo "--- Can't prepare MODIFIED_FILES for $TRAVIS_COMMIT_RANGE";
fi;
- echo --- Configure required LLVM and Ubuntu Toolchain repositories;
if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$CC" == "clang" ]]; then
PACKAGES="llvm-$VERSION-dev $PACKAGES";
curl -sSL "http://apt.llvm.org/llvm-snapshot.gpg.key" | sudo -E apt-key add -;
echo "deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-$VERSION main" | sudo tee -a /etc/apt/sources.list > /dev/null;
sudo -E apt-add-repository -y "ppa:ubuntu-toolchain-r/test";
fi;
if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$CC" == "gcc" ]]; then
sudo -E apt-add-repository -y "ppa:jonathonf/gcc";
fi;
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
sudo -E apt-add-repository -y "ppa:jonathonf/mysql";
fi;
- echo --- Update list of packages and download dependencies;
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
CC=$CC-$VERSION;
CXX=$CXX-$VERSION;
sudo -E apt-get -yq update >> ~/apt-get-update.log 2>&1;
sudo -E apt-get -yq --no-install-suggests --no-install-recommends install $CXX $PACKAGES cmake cmake-curses-gui bison libncurses5-dev libaio-dev libssl-dev libevent-dev libmecab-dev libprotobuf-dev protobuf-compiler liblz4-dev libnuma-dev || travis_terminate 1;
sudo ln -s $(which ccache) /usr/lib/ccache/$CC;
sudo ln -s $(which ccache) /usr/lib/ccache/$CXX || echo;
else
brew update;
brew install ccache [email protected]; `# protobuf 3.6+ uses C++11 features`;
brew link ccache;
export PATH="/usr/local/opt/ccache/libexec:$PATH";
fi
- mkdir bin; cd bin;
- $CC -v
- $CXX -v
- ccache --version
- ccache --print-config;
ccache --zero-stats;
- echo --- Set cmake parameters;
CMAKE_OPT="
-DCMAKE_BUILD_TYPE=$BUILD
-DBUILD_CONFIG=mysql_release
-DFEATURE_SET=community
-DENABLE_DTRACE=OFF
-DENABLE_DOWNLOADS=1
-DDOWNLOAD_BOOST=1
-DWITH_BOOST=../deps
-DWITH_KEYRING_VAULT=ON
-DWITH_PAM=ON
";
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
CMAKE_OPT+="
-DMYSQL_MAINTAINER_MODE=OFF
-DWITH_PROTOBUF=system
-DWITH_TOKUDB=OFF
-DWITH_ROCKSDB=OFF
-DPROTOBUF_LIBRARY=/usr/local/opt/[email protected]/lib/libprotobuf.dylib
-DPROTOBUF_INCLUDE_DIR=/usr/local/opt/[email protected]/include
-DPROTOBUF_PROTOC_EXECUTABLE=/usr/local/opt/[email protected]/bin/protoc
-DPROTOBUF_PROTOC_LIBRARY=/usr/local/opt/[email protected]/lib/libprotoc.dylib
";
else
CMAKE_OPT+="
-DMYSQL_MAINTAINER_MODE=ON
-DWITH_MECAB=system
";
if [[ "$INVERTED" != "ON" ]]; then
CMAKE_OPT+="
-DWITH_NUMA=ON
";
else
CMAKE_OPT+="
-DWITH_NUMA=OFF
-DWITH_EMBEDDED_SERVER=OFF
-DWITH_EDITLINE=bundled
-DWITH_LIBEVENT=system
-DWITH_LZ4=system
-DWITH_PROTOBUF=system
-DWITH_SSL=system
-DWITH_ZLIB=bundled
-DWITH_ARCHIVE_STORAGE_ENGINE=OFF
-DWITH_BLACKHOLE_STORAGE_ENGINE=OFF
-DWITH_EXAMPLE_STORAGE_ENGINE=ON
-DWITH_FEDERATED_STORAGE_ENGINE=OFF
-DWITH_QUERY_RESPONSE_TIME=ON
-DWITHOUT_PARTITION_STORAGE_ENGINE=ON
-DWITHOUT_PERFSCHEMA_STORAGE_ENGINE=ON
-DWITH_SCALABILITY_METRICS=ON
-DWITH_INNODB_MEMCACHED=ON
";
fi;
`# disable RocksDB for gcc-8 until MyRocks is warning-free`;
if [[ "$CC" == "gcc-8" ]]; then NOT_GCC_8=0; else NOT_GCC_8=1; fi;
if [[ "$TRAVIS_REPO_SLUG" == "percona/percona-server" ]]; then
CMAKE_OPT+=" -DWITH_TOKUDB=ON -DWITH_ROCKSDB=$NOT_GCC_8";
else
`# disable TokuDB or RocksDB as developers' forks must fit in the 50 min time limit`;
if [[ "$BUILD" == "Debug" ]] && [[ "$CC" == "clang-$VERSION" ]]; then
CMAKE_OPT+=" -DWITH_TOKUDB=OFF -DWITH_ROCKSDB=$NOT_GCC_8";
else
CMAKE_OPT+=" -DWITH_TOKUDB=ON -DWITH_ROCKSDB=OFF";
fi;
fi;
fi;
- echo --- Perform Debug or RelWithDebInfo compilation;
echo --- CMAKE_OPT=\"$CMAKE_OPT\";
echo --- ENV_VAR_CMAKE_OPT=\"$ENV_VAR_CMAKE_OPT\";
cmake ..
$CMAKE_OPT
$ENV_VAR_CMAKE_OPT
- make -j2 || travis_terminate 1
- ccache --show-stats