forked from bloomberg/corokafka
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
98 lines (84 loc) · 3.09 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
language: cpp
sudo: required
compiler:
- g++
- clang
os: linux
dist: bionic
addons:
apt:
update: true
sources:
- sourceline: 'ppa:mhier/libboost-latest'
packages:
- ninja-build
- libboost1.70-dev
- valgrind
- zookeeper
- zookeeperd
- gdb
env:
global:
- CXX_STANDARD=17
- TEST_DIR=tests
- EXEC=$TEST_DIR/CoroKafkaTests.Linux
after_failure:
- COREFILE=$(find $TRAVIS_BUILD_DIR/cores -maxdepth 1 -name "core.*" -print | head -1)
- echo $COREFILE
- if [[ -f "$COREFILE" ]]; then gdb -c "$COREFILE" $EXEC -ex "thread apply all bt" -ex "set pagination 0" -batch; fi
before_script:
- ulimit -c
- ulimit -a -S
- ulimit -a -H
- mkdir -p -m 0777 $TRAVIS_BUILD_DIR/cores
- sudo sysctl -w kernel.core_pattern=$TRAVIS_BUILD_DIR/cores/core.%e.%p
- cat /proc/sys/kernel/core_pattern
- service --status-all || true
- KAFKA_VERSION=2.12-2.4.0
- RD_KAFKA_VERSION=v1.3.0
- wget http://apache.cs.utah.edu/kafka/2.4.0/kafka_$KAFKA_VERSION.tgz && tar -xvzf kafka_$KAFKA_VERSION.tgz
- ./kafka_$KAFKA_VERSION/bin/kafka-server-start.sh ./kafka_$KAFKA_VERSION/config/server.properties > /dev/null 2> /dev/null &
- while ! echo "asd" | nc localhost 9092; do sleep 1; done
- ./kafka_$KAFKA_VERSION/bin/kafka-topics.sh --create --zookeeper localhost:2181 --topic topic_no_headers --partitions 4 --replication-factor 1
- ./kafka_$KAFKA_VERSION/bin/kafka-topics.sh --create --zookeeper localhost:2181 --topic topic_with_headers --partitions 4 --replication-factor 1
script:
- ulimit -c unlimited -S #enable core dumps
- INSTALL_DIR=/home/travis/build/accelerated/corokafka/install
- mkdir install
# Build and install GTEST framework
- git clone https://github.com/google/googletest.git
- cd googletest
- cmake -DCMAKE_CXX_STANDARD=$CXX_STANDARD -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR -S . -G Ninja
- ninja install
- cd ..
# Build and install rdkafka
- git clone https://github.com/edenhill/librdkafka.git --branch $RD_KAFKA_VERSION
- cd librdkafka
- cmake -DCMAKE_CXX_STANDARD=$CXX_STANDARD -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR -S . -G Ninja
- ninja install
- cd ..
# Build and install cppkafka
- git clone https://github.com/mfontanini/cppkafka.git
- cd cppkafka
- cmake -DCMAKE_CXX_STANDARD=$CXX_STANDARD -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR -S . -G Ninja
- ninja install
- cd ..
# Build and install quantum
- git clone https://github.com/bloomberg/quantum.git
- cd quantum
- cmake -DCMAKE_CXX_STANDARD=$CXX_STANDARD -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR -DQUANTUM_BOOST_USE_VALGRIND=ON -S . -G Ninja
- ninja install
- cd ..
# Build and run corokafka
- cmake -DCMAKE_CXX_STANDARD=$CXX_STANDARD
-DCMAKE_VERBOSE_MAKEFILE=ON
-DCMAKE_PREFIX_PATH=$INSTALL_DIR
-DCOROKAFKA_CPPKAFKA_STATIC_LIB=ON
-DCOROKAFKA_RDKAFKA_STATIC_LIB=ON
-DCOROKAFKA_BOOST_STATIC_LIBS=OFF
-DCOROKAFKA_ENABLE_PIC=ON
-DCOROKAFKA_ENABLE_TESTS=ON
-DCMAKE_BUILD_TYPE=Debug
-G Ninja -S .
- ninja CoroKafkaTests
- $EXEC -b localhost:9092 -k producer -t topic_with_headers -n topic_no_headers