-
Notifications
You must be signed in to change notification settings - Fork 104
/
.travis.yml
executable file
·190 lines (183 loc) · 7.62 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
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.17.3/cmake-3.17.3-Linux-x86_64.sh
- PANDOC_PREFIX=$HOME/prebuilt/pandoc ;
- PANDOC_LINUX_URL=https://github.com/jgm/pandoc/releases/download/2.9.2.1/pandoc-2.9.2.1-linux-amd64.tar.gz
- DOXYGEN_PREFIX=$HOME/prebuilt/doxygen
- DOXYGEN_LINUX_URL=http://doxygen.nl/files/doxygen-1.8.18.linux.bin.tar.gz
matrix:
include:
- os: osx
osx_image: xcode12
env: USE_CC=clang USE_CXX=clang++ CMAKE_BIN=cmake
- os: osx
env: USE_CC=clang USE_CXX=clang++ CMAKE_BIN=cmake
# osx_image: xcode9.4 # default xcode9.4
- os: linux
dist: bionic
sudo: required
env: USE_CC=gcc USE_CXX=g++ CMAKE_BIN=$CMAKE_PREFIX/bin/cmake
- os: linux
dist: bionic
sudo: required
env: USE_CC=gcc-4.8 USE_CXX=g++-4.8 CMAKE_BIN=$CMAKE_PREFIX/bin/cmake
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-4.8
- gcc-4.8-multilib
- g++-4.8
- g++-4.8-multilib
- os: linux
dist: bionic
sudo: required
env: USE_CC=gcc-10 USE_CXX=g++-10 CMAKE_BIN=$CMAKE_PREFIX/bin/cmake
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-10
- gcc-10-multilib
- g++-10
- g++-10-multilib
- os: linux
dist: bionic
sudo: required
env: USE_CC=gcc-10 USE_CXX=g++-10 BUILD_SHARED_LIBS=ON CMAKE_BIN=$CMAKE_PREFIX/bin/cmake
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-10
- gcc-10-multilib
- g++-10
- g++-10-multilib
- os: linux
dist: bionic
sudo: required
env: USE_CC=doxygen USE_CXX=doxygen PANDOC_BIN=$PANDOC_PREFIX/bin/pandoc CMAKE_BIN=$CMAKE_PREFIX/bin/cmake
addons:
apt:
sources:
- ubuntu-toolchain-r-test
# - llvm-toolchain-bionic-6.0
packages:
- graphviz
- doxygen
- python3
- python3-pip
- python3-setuptools
- python3-six
script: |
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";
export PATH="$HOME/.local/bin:$PATH" ;
python3 -m pip install --user --upgrade pip;
python3 -m pip install --user --upgrade -r requirements.txt;
# if [[ ! -e "$DOXYGEN_PREFIX/bin/doxygen" ]]; 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
mkdir -p sphinx/doxygen ;
doxygen libcopp.doxyfile;
du -sh sphinx/doxygen/* ;
sphinx-build -b html -a -D breathe_projects.libcopp=doxygen/xml sphinx output;
if [[ -e "output/doxygen/html" ]]; then
rm -rf "output/doxygen/html";
fi
mkdir -p output/doxygen/ ;
mv -f "sphinx/doxygen/html" "output/doxygen/html";
after_success: |
if [[ -e output ]]; then
cd output ;
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: bionic
# sudo: required
# env: USE_CC=clang USE_CXX=clang++ CMAKE_BIN=$CMAKE_PREFIX/bin/cmake
# - os: linux
# dist: bionic
# sudo: required
# env: USE_CC=clang-3.8 USE_CXX=clang++-3.8 CMAKE_BIN=$CMAKE_PREFIX/bin/cmake
- os: linux
dist: bionic
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
- PROJECT_ADDON_OPTIONS=()
- REPO_DIR=$PWD ;
- if [ "x$BUILD_SHARED_LIBS" != "x" ]; then PROJECT_ADDON_OPTIONS=(${PROJECT_ADDON_OPTIONS[@]} "-DBUILD_SHARED_LIBS=ON"); fi
- 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 ${PROJECT_ADDON_OPTIONS[@]}" ;
- $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 ${PROJECT_ADDON_OPTIONS[@]};
- $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 ${PROJECT_ADDON_OPTIONS[@]}" ;
- $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 ${PROJECT_ADDON_OPTIONS[@]};
- 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}"