forked from Restream/reindexer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
103 lines (87 loc) · 3.95 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
sudo: required
dist: trusty
language: cpp
env:
global:
- BUILD_DIR=${TRAVIS_BUILD_DIR}/build
- GOPATH=$HOME/.gopath/
cache:
directories:
- $HOME/.cache
git:
depth: 100000
.stage_build_linux_template: &stage_build_linux_template
async: true
fail_fast: true
os: linux
dist: bionic
env:
- WITH_DOXYGEN=0 # set to 1 when doxy doc deploy is ready
- CMAKE_OPTS="-DCMAKE_BUILD_TYPE=Release -DENABLE_LIBUNWIND=Off"
before_install:
- mkdir -p ${BUILD_DIR}
- mkdir -p ${GOPATH}/src/github.com/restream && ln -s `pwd` ${GOPATH}/src/github.com/restream/reindexer
install:
- sudo apt-get -qq update > /dev/null && sudo apt-get -qq install -y -f build-essential binutils cmake curl git google-perftools libgoogle-perftools-dev libsnappy-dev libleveldb-dev flex python3-pip
- curl https://raw.githubusercontent.com/travis-ci/gimme/master/gimme > ~/gimme && chmod +x ~/gimme && eval "$(~/gimme 1.13.1)"
before_script:
- git clone https://github.com/google/googletest.git /tmp/dep_googletest && cd /tmp/dep_googletest && cmake -DBUILD_GMOCK=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-std=c++11" . && make -j4 && sudo make install
- git clone https://github.com/google/benchmark.git /tmp/dep_googlebench && cd /tmp/dep_googlebench && git checkout tags/v1.4.0 -b v.1.4.0 && cmake -DBENCHMARK_ENABLE_TESTING=Off -DCMAKE_BUILD_TYPE=Release . && make -j4 && sudo make install
- if [[ ${WITH_DOXYGEN} -eq 1 ]]; then git clone https://github.com/doxygen/doxygen.git /tmp/dep_doxygen && cd /tmp/dep_doxygen && cmake -DCMAKE_BUILD_TYPE=Release . && make -j4 && sudo make install; fi
- if [[ ${WITH_DOXYGEN} -eq 1 ]]; then git clone https://github.com/mosra/m.css.git /tmp/dep_mcss && sudo ln -s /tmp/dep_mcss/doxygen/dox2html5.py /usr/local/bin; fi
- go get github.com/cheggaaa/deepcopy
- go get gopkg.in/yaml.v2
- go get github.com/golang/snappy
- go get github.com/stretchr/testify/assert
- go get github.com/iancoleman/orderedmap
- go get github.com/hashicorp/golang-lru
script:
- cd ${BUILD_DIR} && cmake ${CMAKE_OPTS} ${TRAVIS_BUILD_DIR} && make -j4
- ctest --verbose
- cd ${TRAVIS_BUILD_DIR} && go test ./test -bench . -cpu 1 -benchmem -benchtime 100ms
after_script:
- find . -name CMakeFiles | xargs -n1 rm -rf
.stage_build_linux_asan_template: &stage_build_linux_asan_template
<<: *stage_build_linux_template
env:
- WITH_DOXYGEN=0
- CMAKE_OPTS="-DWITH_ASAN=On -DENABLE_LIBUNWIND=Off"
script:
- cd ${BUILD_DIR} && cmake ${CMAKE_OPTS} ${TRAVIS_BUILD_DIR} && make -j4
- ctest --verbose
- cd ${TRAVIS_BUILD_DIR} && CGO_LDFLAGS=-fsanitize=address go test ./test -bench . -cpu 1 -benchmem -benchtime 100ms -seedcount 50000 -timeout 12m
.stage_build_linux_tsan_template: &stage_build_linux_tsan_template
<<: *stage_build_linux_template
env:
- WITH_DOXYGEN=0
- CMAKE_OPTS="-DWITH_TSAN=On -DENABLE_LIBUNWIND=Off"
.stage_build_linux_cov_template: &stage_build_linux_cov_template
<<: *stage_build_linux_template
env:
- WITH_DOXYGEN=0
- CMAKE_OPTS="-DWITH_GCOV=On -DENABLE_LIBUNWIND=Off"
script:
- cd ${BUILD_DIR} && cmake ${CMAKE_OPTS} ${TRAVIS_BUILD_DIR} && make -j4
- ctest --verbose
.stage_build_osx_template: &stage_build_osx_template
<<: *stage_build_linux_template
env:
- CMAKE_OPTS="-DCMAKE_BUILD_TYPE=Release -DENABLE_LIBUNWIND=Off -DWITH_PYTHON=Off"
os: osx
osx_image: xcode11.3
install:
- brew update > /dev/null && brew install gperftools leveldb snappy flex
- sudo sysctl -w kern.maxfiles=20480 && sudo sysctl -w kern.maxfilesperproc=20480 && sudo launchctl limit maxfiles 20480
- ulimit -S -n 20480 && ulimit -n
jobs:
include:
- stage: build
<<: *stage_build_osx_template
- stage: build
<<: *stage_build_linux_template
- stage: build
<<: *stage_build_linux_asan_template
# - stage: build
# <<: *stage_build_linux_tsan_template
- stage: build
<<: *stage_build_linux_cov_template