forked from akopytov/sysbench
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
269 lines (246 loc) · 6.33 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
# vim ft=yaml
#
# Travis CI configuration
arch:
- amd64
- arm64
dist: trusty
sudo: required
services:
- docker
- mysql
- postgresql
git:
depth: 100500
language: c
os:
- linux
- osx
osx_image: xcode12.2
compiler:
- gcc
- clang
env:
matrix:
- TARGET=distcheck
- TARGET=test
- TARGET=coverage
- OS=el DIST=7
- OS=el DIST=8
- OS=fedora DIST=32
# Currently unsupported by packagecloud
# - OS=fedora DIST=33
- OS=ubuntu DIST=xenial
- OS=ubuntu DIST=bionic
- OS=ubuntu DIST=focal
- OS=ubuntu DIST=groovy
- OS=debian DIST=stretch
- OS=debian DIST=buster
- OS=debian DIST=sid
- OS=ubuntu DIST=xenial ARCH=i386
- OS=ubuntu DIST=bionic ARCH=i386
- OS=debian DIST=stretch ARCH=i386
- OS=debian DIST=buster ARCH=i386
- OS=debian DIST=sid ARCH=i386
matrix:
exclude:
- env: OS=el DIST=7
compiler: clang
- env: OS=el DIST=8
compiler: clang
- env: OS=fedora DIST=32
compiler: clang
- env: OS=fedora DIST=33
compiler: clang
- env: OS=ubuntu DIST=xenial
compiler: clang
- env: OS=ubuntu DIST=bionic
compiler: clang
- env: OS=ubuntu DIST=disco
compiler: clang
- env: OS=ubuntu DIST=focal
compiler: clang
- env: OS=ubuntu DIST=groovy
compiler: clang
- env: OS=debian DIST=stretch
compiler: clang
- env: OS=debian DIST=buster
compiler: clang
- env: OS=debian DIST=sid
compiler: clang
- env: OS=ubuntu DIST=xenial ARCH=i386
compiler: clang
- env: OS=ubuntu DIST=bionic ARCH=i386
compiler: clang
- env: OS=ubuntu DIST=disco ARCH=i386
compiler: clang
- env: OS=debian DIST=stretch ARCH=i386
compiler: clang
- env: OS=debian DIST=buster ARCH=i386
compiler: clang
- env: OS=debian DIST=sid ARCH=i386
compiler: clang
- env: OS=ubuntu DIST=xenial ARCH=i386
arch: arm64
- env: OS=ubuntu DIST=bionic ARCH=i386
arch: arm64
- env: OS=ubuntu DIST=disco ARCH=i386
arch: arm64
- env: OS=debian DIST=stretch ARCH=i386
arch: arm64
- env: OS=debian DIST=buster ARCH=i386
arch: arm64
- env: OS=debian DIST=sid ARCH=i386
arch: arm64
- env: OS=el DIST=7
os: osx
- env: OS=el DIST=8
os: osx
- env: OS=fedora DIST=32
os: osx
- env: OS=fedora DIST=33
os: osx
- env: OS=ubuntu DIST=xenial
os: osx
- env: OS=ubuntu DIST=bionic
os: osx
- env: OS=ubuntu DIST=disco
os: osx
- env: OS=ubuntu DIST=focal
os: osx
- env: OS=ubuntu DIST=groovy
os: osx
- env: OS=debian DIST=stretch
os: osx
- env: OS=debian DIST=buster
os: osx
- env: OS=debian DIST=sid
os: osx
- env: TARGET=distcheck
compiler: clang
- env: TARGET=distcheck
os: osx
- env: TARGET=distcheck
arch: arm64
- env: TARGET=coverage
os: osx
- env: TARGET=coverage
compiler: clang
- env: TARGET=coverage
arch: arm64
- os: osx
compiler: gcc
- os: osx
arch: arm64
- arch: arm64
compiler: clang
addons:
apt:
packages:
- libmysqlclient-dev
- libpq-dev
- libaio-dev
- clang-3.6
before_install:
# Upload builds corresponding to release tags to the 'sysbench'
# repository, push other ones to 'sysbench-prereleases'
- git describe --long --always
- commits=$(git describe --long --always | sed -n 's/^\([0-9\.]*\)-\([0-9]*\)-\([a-z0-9]*\)/\2/p')
- >
if [ ${commits:-0} = 0 ]; then
export VERSION=$(git describe)
PACKAGECLOUD_REPO=sysbench
else
PACKAGECLOUD_REPO=sysbench-prereleases
fi
- >
if [ "x$TARGET" = "xtest" ]; then
case "${TRAVIS_OS_NAME:-linux}" in
osx)
brew update
brew install mysql postgresql
# OS X requires servers to be started explicitly
brew services start mysql
cat /usr/local/var/mysql/*.err
lsof -c mysql
brew postgresql-upgrade-database
brew services start postgresql
echo "Starting PostgreSQL"
pg_ctl -wD /usr/local/var/postgres start
echo "Creating user postgres"
createuser -s postgres
;;
linux)
export ASAN_OPTIONS="detect_leaks=0"
if [ "${CC}" = "clang" ]; then
CC=clang-3.6
fi
;;
esac
fi
install:
- >
case "${TRAVIS_OS_NAME:-linux}" in
osx)
# OS X requires this for user-local pip packages
export PATH=~/Library/Python/2.7/bin:$PATH
;;
linux)
pip install --user cpp-coveralls
;;
esac
before_script:
- mysql -u root -e 'CREATE DATABASE sbtest'
- psql -U postgres -c 'CREATE DATABASE sbtest'
script:
- >
if [ -n "$TARGET" ]; then
case "$TARGET" in
test)
./autogen.sh && ./configure --with-mysql --with-pgsql
make
SBTEST_MYSQL_ARGS="--mysql-user=root" SBTEST_PGSQL_ARGS="--pgsql-user=postgres" make test
;;
distcheck)
./autogen.sh && ./configure --without-mysql
make
make distcheck
;;
coverage)
./autogen.sh && ./configure --enable-coverage --enable-asan --enable-msan --with-mysql --with-pgsql
make -j2
SBTEST_MYSQL_ARGS="--mysql-user=root" SBTEST_PGSQL_ARGS="--pgsql-user=postgres" make test
;;
esac
else
# To avoid name conflicts, deploy source packages only for
# "default", i.e. x86_64 architecture
if [[ -z "$ARCH" && "$TRAVIS_CPU_ARCH" == amd64 ]]; then
PACKAGECLOUD_GLOB='build/*.{rpm,deb,dsc}'
else
# Exclude *.src.rpm and *.dsc
PACKAGECLOUD_GLOB='build/*{[^c].rpm,.deb}'
fi
git clone https://github.com/akopytov/packpack.git packpack
packpack/packpack
fi
deploy:
# Deploy packages to PackageCloud
- provider: packagecloud
username: "${PACKAGECLOUD_USER}"
repository: "${PACKAGECLOUD_REPO}"
token: "${PACKAGECLOUD_TOKEN}"
dist: "${OS}/${DIST}"
package_glob: "${PACKAGECLOUD_GLOB}"
skip_cleanup: true
on:
all_branches: true
condition: -n "$OS" && -n "$DIST" && -n "$PACKAGECLOUD_TOKEN" && "$DIST" != "rawhide" && "$DIST" != "sid"
after_success:
- >
if [ "x$TARGET" = "xcoverage" ]; then
coveralls --exclude third_party/ --gcov-options '\-lp'
fi
# Local variables:
# mode: yaml
# End: