forked from DigitalInBlue/Celero
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
189 lines (156 loc) · 6.7 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
# Originally pulled from https://gist.githubusercontent.com/Kimundi/10d299e905941e82bee4969acc7b64a8/raw/a354ad14ba0da0f05d4ce07e06d92b8ed18fa8f5/c++%2520example%2520travis.yml
# Reference Sites
# https://riptutorial.com/cmake/example/4723/configure-travis-ci-with-newest-cmake
language: c++
sudo: false
git:
submodules: true
# Do not build branches of the form "pr/*". By prefixing pull requests coming
# from branches inside the repository with pr/, this avoids building both the
# branch push _and_ the pull request.
branches:
except: /pr\/.*/
env:
# Workaround for https://github.com/travis-ci/travis-ci/issues/4681
matrix:
- TRAVIS_EMPTY_JOB_WORKAROUND=true
addons:
apt:
packages:
- g++-6
- g++-7
- g++-8
sources: &sources
- ubuntu-toolchain-r-test
cache:
directories:
- ${TRAVIS_BUILD_DIR}/deps/llvm-3.9.0
- ${TRAVIS_BUILD_DIR}/deps/llvm-5.0.1
- ${TRAVIS_BUILD_DIR}/deps/llvm-7.0.0
- ${TRAVIS_BUILD_DIR}/deps/llvm-8.0.0
matrix:
exclude:
- env: TRAVIS_EMPTY_JOB_WORKAROUND=true
include:
##########################################################################
# Build with the main configuration on all the supported compilers
#
# Note that we only use the memory checker on the main configuration to
# speed up Travis builds.
##########################################################################
# Clang 3.9
- os: linux
env: LLVM_VERSION=3.9.0 CMAKE_OPTIONS="-DCELERO_ENABLE_TESTS=1"
compiler: clang
# Clang 5.0.1
- os: linux
env: LLVM_VERSION=5.0.1 CMAKE_OPTIONS="-DCELERO_ENABLE_TESTS=1"
compiler: clang
# Clang 7.0.0
- os: linux
env: LLVM_VERSION=7.0.0 CMAKE_OPTIONS="-DCELERO_ENABLE_TESTS=1"
compiler: clang
# Clang 8.0.0
- os: linux
env: LLVM_VERSION=7.0.0 CMAKE_OPTIONS="-DCELERO_ENABLE_TESTS=1"
compiler: clang
# GCC 6
- os: linux
env: COMPILER=g++-6 CMAKE_OPTIONS="-DCELERO_ENABLE_TESTS=1"
compiler: gcc
# GCC 7
- os: linux
env: COMPILER=g++-7 CMAKE_OPTIONS="-DCELERO_ENABLE_TESTS=1"
compiler: gcc
# GCC 8
- os: linux
env: COMPILER=g++-8 CMAKE_OPTIONS="-DCELERO_ENABLE_TESTS=1"
compiler: gcc
# GCC 8
- os: linux
name: Complete Build
env: COMPILER=g++-8 CMAKE_OPTIONS="-DCELERO_ENABLE_TESTS=1 -DCELERO_ENABLE_EXPERIMENTS=1"
compiler: gcc
##########################################################################
# Build with variations in the configuration
##########################################################################
# With debug mode
- os: linux
name: Debug Build
env: LLVM_VERSION=default CMAKE_OPTIONS="-DCELERO_ENABLE_TESTS=1 -DCMAKE_BUILD_TYPE=DEBUG"
compiler: clang
# Temporarily broken within Travis.CI for CMake's update
# - os: osx
# osx_image: xcode10.1
- os: osx
osx_image: xcode10.3
- os: osx
osx_image: xcode11
before_install:
- git submodule update --init --recursive
install:
############################################################################
# All the dependencies are installed in ${TRAVIS_BUILD_DIR}/deps/
############################################################################
- DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
- mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR}
############################################################################
# Setup default versions and override compiler if needed
############################################################################
- if [[ "${LLVM_VERSION}" == "default" ]]; then LLVM_VERSION=3.9.0; fi
- if [[ "${COMPILER}" != "" ]]; then export CXX=${COMPILER}; fi
############################################################################
# Install a recent CMake
############################################################################
- |
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
CMAKE_URL="https://cmake.org/files/v3.15/cmake-3.15.4-Linux-x86_64.tar.gz"
mkdir cmake && travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake
export PATH=${DEPS_DIR}/cmake/bin:${PATH}
else
brew upgrade cmake || brew install cmake
fi
- cmake --version
############################################################################
# Install Clang, libc++ and libc++abi
############################################################################
- |
if [[ "${LLVM_VERSION}" != "" ]]; then
LLVM_DIR=${DEPS_DIR}/llvm-${LLVM_VERSION}
if [[ -z "$(ls -A ${LLVM_DIR})" ]]; then
LLVM_URL="http://llvm.org/releases/${LLVM_VERSION}/llvm-${LLVM_VERSION}.src.tar.xz"
LIBCXX_URL="http://llvm.org/releases/${LLVM_VERSION}/libcxx-${LLVM_VERSION}.src.tar.xz"
LIBCXXABI_URL="http://llvm.org/releases/${LLVM_VERSION}/libcxxabi-${LLVM_VERSION}.src.tar.xz"
CLANG_URL="http://llvm.org/releases/${LLVM_VERSION}/clang+llvm-${LLVM_VERSION}-x86_64-linux-gnu-ubuntu-14.04.tar.xz"
mkdir -p ${LLVM_DIR} ${LLVM_DIR}/build ${LLVM_DIR}/projects/libcxx ${LLVM_DIR}/projects/libcxxabi ${LLVM_DIR}/clang
travis_retry wget --quiet -O - ${LLVM_URL} | tar --strip-components=1 -xJ -C ${LLVM_DIR}
travis_retry wget --quiet -O - ${LIBCXX_URL} | tar --strip-components=1 -xJ -C ${LLVM_DIR}/projects/libcxx
travis_retry wget --quiet -O - ${LIBCXXABI_URL} | tar --strip-components=1 -xJ -C ${LLVM_DIR}/projects/libcxxabi
travis_retry wget --quiet -O - ${CLANG_URL} | tar --strip-components=1 -xJ -C ${LLVM_DIR}/clang
(cd ${LLVM_DIR}/build && cmake .. -DCMAKE_INSTALL_PREFIX=${LLVM_DIR}/install -DCMAKE_CXX_COMPILER=clang++)
(cd ${LLVM_DIR}/build/projects/libcxx && make install -j2)
(cd ${LLVM_DIR}/build/projects/libcxxabi && make install -j2)
fi
export CXXFLAGS="-nostdinc++ -isystem ${LLVM_DIR}/install/include/c++/v1"
export LDFLAGS="-L ${LLVM_DIR}/install/lib -l c++ -l c++abi"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${LLVM_DIR}/install/lib"
export PATH="${LLVM_DIR}/clang/bin:${PATH}"
fi
- ${CXX} --version
before_script:
############################################################################
# Go back to the root of the project and setup the build directory
############################################################################
- ls -alt ${TRAVIS_BUILD_DIR}/deps/
- cd ${TRAVIS_BUILD_DIR}
- (mkdir build && cd build && cmake .. ${CMAKE_OPTIONS})
script:
############################################################################
# Build
############################################################################
- cd ${TRAVIS_BUILD_DIR}
- cd build
- make
after_success:
- ls
- ./celero-test