forked from tikv/titan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
95 lines (87 loc) · 2.15 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
dist: focal
language: cpp
os: linux
compiler: clang
osx_image: xcode12.2
addons:
apt:
packages:
- clang-format-10
- g++-9
- libgflags-dev
- liblz4-dev
- libsnappy-dev
- libzstd-dev
- lcov
- zlib1g
env:
- BUILD_TYPE="Release"
- SANITIZER="ASAN"
- SANITIZER="TSAN"
- SANITIZER="UBSAN"
# For GCC build, we also report code coverage to codecov.
matrix:
exclude:
- os: osx
env: SANITIZER="TSAN"
- os: osx
env: SANITIZER="UBSAN"
- os: osx
env: BUILD_TYPE="Release"
include:
- os: linux
compiler:
env:
- COMPILER=gcc9
- os: linux
arch: arm64
env:
- SANITIZER="ASAN"
- os: osx
env:
- SANITIZER="ASAN"
- os: linux
compiler:
env:
- FORMATTER=ON
install:
# osx dependencies
- if [ "${TRAVIS_OS_NAME}" == osx ]; then
to_install=( "gflags" "zstd" "lz4" "snappy" "xz" );
brew list > tmp;
for ins in ${to_install[*]}; do
grep -q "$ins" tmp;
if [ $? -ne 0 ]; then
brew install "$ins";
fi
done
fi
- export CTEST_OUTPUT_ON_FAILURE=1
- if [ "${COMPILER}" == gcc9 ]; then
CC=gcc-9;
CXX=g++-9;
export COVERAGE_OPT="-DCODE_COVERAGE=ON";
fi
- if [ ! -z "${BUILD_TYPE}" ]; then
export BUILD_OPT="-DCMAKE_BUILD_TYPE=${BUILD_TYPE}";
else
export BUILD_OPT="-DCMAKE_BUILD_TYPE=Debug";
fi
- if [ ! -z "${SANITIZER}" ]; then
export SANITIZER_OPT="-DWITH_${SANITIZER}=ON";
export TOOLS_OPT="-DWITH_TITAN_TOOLS=OFF";
fi
- export COMPRESSION_OPT="-DWITH_SNAPPY=ON -DWITH_LZ4=ON -DWITH_ZLIB=ON -DWITH_ZSTD=ON"
script:
- if [ -z "${FORMATTER}" ]; then
bash scripts/travis-make.sh;
else
bash scripts/travis-format.sh;
fi
after_success:
- if [ "${COMPILER}" == gcc9 ]; then
lcov --gcov-tool gcov-7 --directory . --capture --output-file coverage.info;
lcov --remove coverage.info '/usr/*' --output-file coverage.info;
lcov --list coverage.info;
bash <(curl -s https://codecov.io/bash) -f coverage.info || echo "Codecov did not collect coverage reports";
fi