-
Notifications
You must be signed in to change notification settings - Fork 7
/
.travis.yml
74 lines (61 loc) · 1.89 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
# Please refer to https://docs.travis-ci.com/
language: cpp
sudo: required
dist: bionic # ubuntu 18.04
#os:
# - linux
compiler:
- gcc
- clang
os:
- linux
- osx
branches:
only:
- master
- mkf-master
matrix:
exclude:
# Use clang in osx, and gcc in linux
- compiler: gcc
os: osx
- compiler: clang
os: linux
env:
global:
- CACHE_DIR1=$([ $TRAVIS_OS_NAME = 'osx' ] && echo "$HOME/Library/Caches/Homebrew" || echo "$HOME/apt")
- CACHE_DIR1=$([ $TRAVIS_OS_NAME = 'osx' ] && echo "/usr/local/Homebrew" || echo "/usr/local/apt")
cache:
directories:
- $CACHE_DIR1
- $CACHE_DIR2
before_cache:
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then brew cleanup; fi
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then find /usr/local/Homebrew \! -regex ".+\.git.+" -delete; fi
install:
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then
brew update;
brew install cmake pkg-config openssl boost libsodium readline protobuf ncurses;
export OPENSSL_ROOT_DIR=`brew --prefix openssl`;
else
sudo apt-get update -qq;
sudo apt install -y g++ cmake libboost-all-dev openssl libssl1.0-dev libreadline-dev pkg-config libprotobuf-dev protobuf-compiler libncurses5-dev autoconf;
sudo apt install -y cppcheck valgrind clang-format-8;
wget https://github.com/jedisct1/libsodium/releases/download/1.0.18-RELEASE/libsodium-1.0.18.tar.gz;
tar -zxvf libsodium-1.0.18.tar.gz;
cd libsodium-1.0.18;
./autogen;
./configure;
make -j2;
sudo make install;
cd ../;
fi
before_script:
- ulimit -c unlimited -S # enable core dumps
script:
- ./INSTALL.sh
- ./build/test/test_big
- ./build/test/test_ctsdb
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
cppcheck --error-exitcode=1 --std=c++11 --enable=warning,performance,portability -i libsodium-1.0.18 -i src/leveldb -i build -i src/snappy -i src/crypto -i src/jsonrpc/json -i src/xengine/docker -i script -i test . ;
fi