forked from owent/libcopp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
executable file
·197 lines (166 loc) · 6.99 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
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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
language: cpp
env:
global:
- LANG="zh_CN.UTF-8"
- CMAKE_PREFIX=$HOME/prebuilt/cmake ;
- CMAKE_LINUX_URL=https://github.com/Kitware/CMake/releases/download/v3.15.2/cmake-3.15.2-Linux-x86_64.sh ;
- PANDOC_PREFIX=$HOME/prebuilt/pandoc ;
- PANDOC_LINUX_URL=https://github.com/jgm/pandoc/releases/download/2.7.3/pandoc-2.7.3-linux.tar.gz
- DOXYGEN_PREFIX=$HOME/prebuilt/doxygen
- DOXYGEN_LINUX_URL=http://doxygen.nl/files/doxygen-1.8.16.linux.bin.tar.gz
matrix:
include:
- os: osx
env: USE_CC=clang USE_CXX=clang++ CMAKE_BIN=cmake
- os: linux
dist: xenial
sudo: required
env: USE_CC=gcc USE_CXX=g++ CMAKE_BIN=$CMAKE_PREFIX/bin/cmake
- os: linux
dist: xenial
sudo: required
env: USE_CC=gcc-4.4 USE_CXX=g++-4.4 CMAKE_BIN=$CMAKE_PREFIX/bin/cmake
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: xenial
sudo: required
env: USE_CC=gcc-4.9 USE_CXX=g++-4.9 CMAKE_BIN=$CMAKE_PREFIX/bin/cmake
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: xenial
sudo: required
env: USE_CC=gcc-9 USE_CXX=g++-9 CMAKE_BIN=$CMAKE_PREFIX/bin/cmake
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-9
- gcc-9-multilib
- g++-9
- g++-9-multilib
- os: linux
dist: xenial
sudo: required
env: USE_CC=doxygen USE_CXX=doxygen PANDOC_BIN=$PANDOC_PREFIX/bin/pandoc DOXYGEN_BIN=doxygen CMAKE_BIN=$CMAKE_PREFIX/bin/cmake # DOXYGEN_BIN=$DOXYGEN_PREFIX/bin/doxygen
addons:
apt:
sources:
- ubuntu-toolchain-r-test
# - llvm-toolchain-xenial-6.0
packages:
- graphviz
- doxygen
script:
- sudo apt-get install -f ;
- REPO_DIR=$PWD ;
- mkdir -p $REPO_DIR/build_for_doxygen && cd $REPO_DIR/build_for_doxygen ;
- echo "$CMAKE_BIN .. -DLIBCOPP_FCONTEXT_USE_TSX=ON -DPROJECT_ENABLE_UNITTEST=ON -DPROJECT_ENABLE_SAMPLE=ON" ;
- $CMAKE_BIN .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLIBCOPP_FCONTEXT_USE_TSX=ON -DPROJECT_ENABLE_UNITTEST=ON -DPROJECT_ENABLE_SAMPLE=ON ;
- cd "$REPO_DIR/docs";
- if [ "doxygen" != "$DOXYGEN_BIN" ] && [ ! -e "$DOXYGEN_BIN" ]; then
mkdir -p "$DOXYGEN_PREFIX";
curl --insecure -L "$DOXYGEN_LINUX_URL" -o doxygen.linux.bin.tar.gz ;
tar -axvf doxygen.linux.bin.tar.gz ;
DOXYGEN_DIR=$(ls -d doxygen-* | grep -v grep | grep -v ".tar.gz");
cp -rf $DOXYGEN_DIR/* "$DOXYGEN_PREFIX";
fi
if [ -e doxygen/html ]; then
rm -rf doxygen/html;
fi
$DOXYGEN_BIN libcopp.doxyfile;
after_success:
- if [ -e doxygen/html ]; then
cd doxygen/html ;
echo "libcopp.atframe.work" > CNAME ;
git init ;
git add . ;
git -c user.name='travis' -c user.email='[email protected]' commit -m "Delpoy document for $TRAVIS_BRANCH($TRAVIS_COMMIT)";
git push -f -q https://owt5008137:[email protected]/owt5008137/libcopp-doc HEAD:master ;
fi
# - os: linux
# dist: xenial
# sudo: required
# env: USE_CC=clang USE_CXX=clang++ CMAKE_BIN=$CMAKE_PREFIX/bin/cmake
# - os: linux
# dist: xenial
# sudo: required
# env: USE_CC=clang-3.8 USE_CXX=clang++-3.8 CMAKE_BIN=$CMAKE_PREFIX/bin/cmake
- os: linux
dist: xenial
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 -DLIBCOPP_FCONTEXT_USE_TSX=ON -DPROJECT_ENABLE_UNITTEST=ON -DPROJECT_ENABLE_SAMPLE=ON ;
- $CMAKE_BIN --build .
after_success:
- make run_sample run_test benchmark ;
- pip install --user cpp-coveralls
- coveralls -r .. --gcov-options '\-lp' -e sample -e test -e build/CMakeFiles
before_install:
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then ulimit -a; sysctl -a; sudo apt-get -qq update; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew 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; fi
script:
- export CC=$USE_CC
- export CXX=$USE_CXX
- REPO_DIR=$PWD ;
- mkdir -p $REPO_DIR/build && cd $REPO_DIR/build ;
- echo "$CMAKE_BIN .. -DLIBCOPP_FCONTEXT_USE_TSX=ON -DPROJECT_ENABLE_UNITTEST=ON -DPROJECT_ENABLE_SAMPLE=ON -DCMAKE_C_COMPILER=$USE_CC -DCMAKE_CXX_COMPILER=$USE_CXX" ;
- $CMAKE_BIN .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLIBCOPP_FCONTEXT_USE_TSX=ON -DPROJECT_ENABLE_UNITTEST=ON -DPROJECT_ENABLE_SAMPLE=ON -DCMAKE_C_COMPILER=$USE_CC -DCMAKE_CXX_COMPILER=$USE_CXX ;
- $CMAKE_BIN --build . ;
- echo "============================== run in thread-safe mode ==============================" ;
- cmake --build . -- run_sample run_test benchmark ;
- rm -rf * ;
- echo "$CMAKE_BIN .. -DLIBCOPP_FCONTEXT_USE_TSX=ON -DPROJECT_ENABLE_UNITTEST=ON -DPROJECT_ENABLE_SAMPLE=ON -DCMAKE_C_COMPILER=$USE_CC -DCMAKE_CXX_COMPILER=$USE_CXX -DLIBCOPP_DISABLE_ATOMIC_LOCK=ON -DLIBCOPP_DISABLE_THIS_MT=ON" ;
- $CMAKE_BIN .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLIBCOPP_FCONTEXT_USE_TSX=ON -DPROJECT_ENABLE_UNITTEST=ON -DPROJECT_ENABLE_SAMPLE=ON -DCMAKE_C_COMPILER=$USE_CC -DCMAKE_CXX_COMPILER=$USE_CXX -DLIBCOPP_DISABLE_ATOMIC_LOCK=ON -DLIBCOPP_DISABLE_THIS_MT=ON ;
- echo "============================== run in thread-unsafe mode ==============================" ;
- cmake --build . -- benchmark ;
cache:
apt: true
ccache: true
directories:
- /home/travis/prebuilt
branches:
only:
- master
- v2
notifications:
email:
recipients:
on_success: change
on_failure: change
irc:
template:
- "%{repository}/%{branch} (%{commit} - %{author}): %{build_url}: %{message}"