forked from owent/libatbus
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.travis.yml
More file actions
177 lines (161 loc) · 7.15 KB
/
.travis.yml
File metadata and controls
177 lines (161 loc) · 7.15 KB
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
language: cpp
env:
global:
- LANG="zh_CN.UTF-8"
- MSGPACK_PREFIX=$HOME/prebuilt/msgpack-2.1.5 ;
- MSGPACK_VERSION=2.1.5 ;
- LIBUV_PREFIX=$HOME/prebuilt/libuv-1.19.1 ;
- LIBUV_VERSION=1.19.1
- CMAKE_PREFIX=$HOME/prebuilt/cmake ;
- CMAKE_LINUX_URL=https://cmake.org/files/v3.10/cmake-3.10.2-Linux-x86_64.sh ;
matrix:
include:
- os: osx
env: USE_CC=clang USE_CXX=clang++ CMAKE_BIN=cmake CTEST_BIN=ctest
- os: linux
dist: trusty
sudo: required
env: USE_CC=gcc USE_CXX=g++ CMAKE_BIN=$CMAKE_PREFIX/bin/cmake CTEST_BIN=$CMAKE_PREFIX/bin/ctest
- os: linux
dist: trusty
sudo: required
env: USE_CC=gcc-4.4 USE_CXX=g++-4.4 CMAKE_BIN=$CMAKE_PREFIX/bin/cmake CTEST_BIN=$CMAKE_PREFIX/bin/ctest # MSGPACK_VERSION=1.4.2
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.4
- g++-4.4-multilib
- gcc-4.4
- gcc-4.4-multilib
- os: linux
dist: trusty
sudo: required
env: USE_CC=gcc-4.9 USE_CXX=g++-4.9 CMAKE_BIN=$CMAKE_PREFIX/bin/cmake CTEST_BIN=$CMAKE_PREFIX/bin/ctest
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-4.9
- gcc-4.9-multilib
- g++-4.9
- g++-4.9-multilib
- os: linux
dist: trusty
sudo: required
env: USE_CC=gcc-7 USE_CXX=g++-7 CMAKE_BIN=$CMAKE_PREFIX/bin/cmake CTEST_BIN=$CMAKE_PREFIX/bin/ctest
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-7
- gcc-7-multilib
- g++-7
- g++-7-multilib
#- os: linux
# dist: trusty
# sudo: required
# env: USE_CC=clang USE_CXX=clang++ CMAKE_BIN=$CMAKE_PREFIX/bin/cmake CTEST_BIN=$CMAKE_PREFIX/bin/ctest
# - os: linux
# dist: trusty
# sudo: required
# env: USE_CC=clang-3.8 USE_CXX=clang++-3.8 CMAKE_BIN=$CMAKE_PREFIX/bin/cmake CTEST_BIN=$CMAKE_PREFIX/bin/ctest
- os: linux
dist: trusty
sudo: required
env: COVERALLS_SERVICE_NAME=travis-ci GCOV_FLAGS='--coverage -fprofile-arcs -ftest-coverage' CMAKE_BIN=$CMAKE_PREFIX/bin/cmake CTEST_BIN=$CMAKE_PREFIX/bin/ctest
# COVERALLS_REPO_TOKEN is set in travis-ci
script:
- REPO_DIR=$PWD;
- USE_MSGPACK_ROOT=$MSGPACK_PREFIX ;
- if [ -e "$REPO_DIR/build" ]; then rm -rf "$REPO_DIR/build"; fi
- mkdir -p $REPO_DIR/build && cd $REPO_DIR/build ;
- $CMAKE_BIN .. "-DCMAKE_C_FLAGS=$GCOV_FLAGS" "-DCMAKE_CXX_FLAGS=$GCOV_FLAGS" "-DCMAKE_EXE_LINKER_FLAGS=$GCOV_FLAGS" -DCMAKE_BUILD_TYPE=Debug -DPROJECT_ENABLE_UNITTEST=ON -DPROJECT_ENABLE_SAMPLE=ON -DPROJECT_ENABLE_TOOLS=ON -DLIBUV_ROOT=$LIBUV_PREFIX -DMSGPACK_ROOT=$USE_MSGPACK_ROOT ;
- $CMAKE_BIN --build .
after_success:
- $CTEST_BIN . -V
# run tools for coverage
- timeout 10s ./tools/benchmark_shm_channel_recv 12345679 1024 4194304 > recv.log 2>&1 &
- timeout 10s ./tools/benchmark_shm_channel_send 12345679 1024 4194304 > send.log 2>&1
- ./tools/show_shm_channel 12345679 1 16 > /dev/null
- pip install --user cpp-coveralls
- coveralls -r .. --gcov-options '\-lp' -e 3rd_party -e sample -e test -e tools -e build/CMakeFiles
before_install:
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get -qq update; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update; fi
# - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test; fi
# - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo add-apt-repository -y "deb http://llvm.org/apt/precise/ llvm-toolchain-precise-3.7 main"; fi
# - if [ "$TRAVIS_OS_NAME" == "linux" ]; then wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add - ; fi
# - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get update -qq; fi
# - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get update; fi
install:
- if [ "$TRAVIS_OS_NAME" == "linux" ] ; then
if [ ! -e "$CMAKE_BIN" ]; then
mkdir -p "$CMAKE_PREFIX";
curl --insecure -L "$CMAKE_LINUX_URL" -o cmake-linux.sh ;
bash cmake-linux.sh --skip-license --prefix=$CMAKE_PREFIX ;
fi
fi
- if [ "$TRAVIS_OS_NAME" == "osx" ] ; then brew upgrade cmake; brew install --HEAD libuv; fi
before_script:
- REPO_DIR=$PWD;
- cd /tmp
- if [ ! -e "$MSGPACK_PREFIX/include/msgpack.hpp" ]; then
mkdir -p "$MSGPACK_PREFIX" ;
wget -c "https://github.com/msgpack/msgpack-c/releases/download/cpp-$MSGPACK_VERSION/msgpack-$MSGPACK_VERSION.tar.gz" -O msgpack-$MSGPACK_VERSION.tar.gz;
tar -xvf msgpack-$MSGPACK_VERSION.tar.gz;
cp -rf msgpack-$MSGPACK_VERSION/include $MSGPACK_PREFIX/ ;
rm -rf msgpack-$MSGPACK_VERSION msgpack-$MSGPACK_VERSION.tar.gz ;
fi
- if [ ! -e "$LIBUV_PREFIX/include/uv.h" ] || [ ! -e "$LIBUV_PREFIX/lib/libuv.so" ] ; then
if [ "$TRAVIS_OS_NAME" == "linux" ] ; then
mkdir -p "$LIBUV_PREFIX";
wget -c "http://dist.libuv.org/dist/v$LIBUV_VERSION/libuv-v$LIBUV_VERSION.tar.gz" -O libuv-v$LIBUV_VERSION.tar.gz;
tar -xvf libuv-v$LIBUV_VERSION.tar.gz;
cd libuv-v$LIBUV_VERSION ;
./autogen.sh;
./configure --prefix=$LIBUV_PREFIX --with-pic=yes --enable-shared=yes --enable-static=no;
make -j4 install;
cd -;
rm -rf libuv-v$LIBUV_VERSION libuv-v$LIBUV_VERSION ;
fi
fi
- cd "$REPO_DIR";
script:
- REPO_DIR=$PWD;
- mkdir -p $REPO_DIR/build && cd $REPO_DIR/build ;
- USE_MSGPACK_ROOT=$MSGPACK_PREFIX ;
- if [ "$TRAVIS_OS_NAME" == "linux" ] ; then
$CMAKE_BIN .. -DCMAKE_C_COMPILER=$USE_CC -DCMAKE_CXX_COMPILER=$USE_CXX -DPROJECT_ENABLE_UNITTEST=ON -DPROJECT_ENABLE_SAMPLE=ON -DPROJECT_ENABLE_TOOLS=ON -DLIBUV_ROOT=$LIBUV_PREFIX -DMSGPACK_ROOT=$USE_MSGPACK_ROOT ;
else
$CMAKE_BIN .. -DCMAKE_C_COMPILER=$USE_CC -DCMAKE_CXX_COMPILER=$USE_CXX -DPROJECT_ENABLE_UNITTEST=ON -DPROJECT_ENABLE_SAMPLE=ON -DPROJECT_ENABLE_TOOLS=ON -DMSGPACK_ROOT=$USE_MSGPACK_ROOT ;
fi
# - $CMAKE_BIN .. -DCMAKE_C_COMPILER=$USE_CC -DCMAKE_CXX_COMPILER=$USE_CXX -DPROJECT_ENABLE_UNITTEST=ON -DPROJECT_ENABLE_SAMPLE=ON -DPROJECT_ENABLE_TOOLS=ON -DLIBUV_ROOT=$LIBUV_PREFIX -DMSGPACK_ROOT=$USE_MSGPACK_ROOT ;
- $CMAKE_BIN --build .
after_success:
- $CTEST_BIN . -V
cache:
apt: true
ccache: true
pip: true
directories:
- /home/travis/prebuilt
branches:
only:
- master
notifications:
email:
recipients:
- admin@owent.net
- owt5008137@live.com
on_success: change
on_failure: change
webhooks:
urls:
- https://webhooks.gitter.im/e/3c7b3960fa5b787ad061
on_success: change # options: [always|never|change] default: always
on_failure: change # options: [always|never|change] default: always
on_start: never # options: [always|never|change] default: always