forked from owent/libatbus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
148 lines (137 loc) · 5.23 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
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
language: cpp
env:
global:
- LANG="zh_CN.UTF-8"
- MSGPACK_PREFIX=$HOME/prebuilt/msgpack-2.0.0 ;
- MSGPACK_VERSION=2.0.0 ;
- LIBUV_PREFIX=$HOME/prebuilt/libuv-1.9.1 ;
- LIBUV_VERSION=1.9.1
matrix:
include:
- os: osx
env: USE_CC=clang USE_CXX=clang++
- os: osx
env: USE_CC=gcc USE_CXX=g++
- os: linux
dist: trusty
sudo: required
env: USE_CC=gcc USE_CXX=g++
- os: linux
dist: trusty
sudo: required
env: USE_CC=gcc-4.4 USE_CXX=g++-4.4 MSGPACK_VERSION=1.4.2
- os: linux
dist: trusty
sudo: required
env: USE_CC=gcc-4.9 USE_CXX=g++-4.9
- os: linux
dist: trusty
sudo: required
env: USE_CC=gcc-6 USE_CXX=g++-6
- os: linux
dist: trusty
sudo: required
env: USE_CC=clang USE_CXX=clang++
# - os: linux
# dist: trusty
# sudo: required
# env: USE_CC=clang-3.8 USE_CXX=clang++-3.8
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- ppa:george-edison55/cmake-3.x
# - sourceline: 'deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-3.8 main'
# key_url: 'http://apt.llvm.org/llvm-snapshot.gpg.key'
packages:
- g++-4.4
- g++-4.4-multilib
- gcc-4.4
- gcc-4.4-multilib
- gcc-4.9
- gcc-4.9-multilib
- g++-4.9
- g++-4.9-multilib
- gcc-6
- gcc-6-multilib
- g++-6
- g++-6-multilib
- clang
## - libc++1
## - libc++-dev
## - libc++abi1
## - libc++abi-dev
# - clang-3.8
# - libclang-common-3.8-dev
# - libclang-3.8-dev
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 sudo apt-get install -qq -y cmake; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ] ; then brew upgrade cmake; brew install --HEAD libuv; fi
# - if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$USE_CC" == "gcc-4.9" ] ; then sudo apt-get install -qq gcc-4.9-multilib g++-4.9-multilib; fi
# - if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$USE_CC" == "clang-3.7" ] ; then sudo apt-get install --allow-unauthenticated -qq clang-3.7; 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 .. -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 .. -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 .. -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 ;
- make -j4 ;
after_success:
- test/atbus_unit_test
cache:
apt: true
ccache: true
directories:
- /home/travis/prebuilt
branches:
only:
- master
notifications:
email:
recipients:
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