forked from spirit-code/spirit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
250 lines (230 loc) · 11.1 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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
sudo: required
dist: trusty
language: cpp
cache:
directories:
- ${TRAVIS_BUILD_DIR}/deps/llvm-3.6.2
- ${TRAVIS_BUILD_DIR}/deps/llvm-3.7.1
- ${TRAVIS_BUILD_DIR}/deps/llvm-3.8.0
- ${TRAVIS_BUILD_DIR}/deps/llvm-3.9.0
env:
global:
- secure: "IeryGzYD1DUkDjFgAscWGQIu7lebz+uN8xi42rWUwBqn8PUpJRoeniEd2/445CdGrX7G3YKDq4YMUFip0n1WyyjmzOQS2dUgJvH3+VU/rtGYoSF8SJkDGXvUl4OTTY0BMGM3+caOb9s91+ZW5C2536e/la0Ti37tu6xq+2URiOZ4ZIxaM+PBJPNJ/e8V9RXPGZxTAlNgpkKrAwv+lVYi7lxqLTTW+0Iu9jilzcAfvZ7tuFvsADNLJ+vEfYSerdeXeq0sma3ez1Z3q+pCyGBv35r/NIsgIH73i9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MCs="
matrix:
include:
# OSX, xcode 8
- os: osx
osx_image: xcode8
env: CMAKE_OPTIONS="-DUSER_PATH_QT=~/usr/local/Cellar/qt/5.11.0" PYPI=true
# Linux, GCC 6
- os: linux
env: COMPILER_C=gcc-6 COMPILER_CXX=g++-6 CMAKE_OPTIONS="-DUSER_PATH_QT=~/opt/qt57" PYPI=true
compiler: g++
addons:
apt:
packages:
- g++-6
- qt57base
- qt57charts-no-lgpl
- ca-certificates
- python2.7
sources:
- sourceline: 'ppa:ubuntu-toolchain-r/test'
- sourceline: 'ppa:beineri/opt-qt571-trusty'
- sourceline: 'ppa:jonathonf/python-2.7'
# Linux, GCC 5.1
- os: linux
env: COMPILER_C=gcc-5 COMPILER_CXX=g++-5 CMAKE_OPTIONS="-DUSER_PATH_QT=~/opt/qt57" PYPI=false
compiler: g++
addons:
apt:
packages:
- g++-5
- qt57base
- qt57charts-no-lgpl
sources:
- sourceline: 'ppa:ubuntu-toolchain-r/test'
- sourceline: 'ppa:beineri/opt-qt571-trusty'
# # Linux, GCC 5.1 CUDA build
# - os: linux
# env: COMPILER_C=gcc-5 COMPILER_CXX=g++-5 RUNTESTS=false USE_CUDA=true CMAKE_OPTIONS="-DUI_CXX_USE_QT=OFF -DSPIRIT_USE_CUDA=ON" PYPI=false
# compiler: g++
# addons:
# apt:
# packages:
# - g++-5
# - qt57base
# - qt57charts-no-lgpl
# sources:
# - sourceline: 'ppa:ubuntu-toolchain-r/test'
# - sourceline: 'ppa:beineri/opt-qt571-trusty'
# Linux, GCC 6 OpenMP build
- os: linux
env: COMPILER_C=gcc-6 COMPILER_CXX=g++-6 OMP_NUM_THREADS=4 CMAKE_OPTIONS="-DUI_CXX_USE_QT=OFF -DSPIRIT_USE_OPENMP=ON" PYPI=false
compiler: g++
addons:
apt:
packages:
- g++-6
- qt57base
- qt57charts-no-lgpl
- ca-certificates
- python2.7
sources:
- sourceline: 'ppa:ubuntu-toolchain-r/test'
- sourceline: 'ppa:beineri/opt-qt571-trusty'
- sourceline: 'ppa:jonathonf/python-2.7'
# Linux, GCC 6 pinning and defects build
- os: linux
env: COMPILER_C=gcc-6 COMPILER_CXX=g++-6 CMAKE_OPTIONS="-DUI_CXX_USE_QT=OFF -DSPIRIT_ENABLE_PINNING=ON -DSPIRIT_ENABLE_DEFECTS=ON" PYPI=false
compiler: g++
addons:
apt:
packages:
- g++-6
- qt57base
- ca-certificates
- python2.7
sources:
- sourceline: 'ppa:ubuntu-toolchain-r/test'
- sourceline: 'ppa:beineri/opt-qt571-trusty'
- sourceline: 'ppa:jonathonf/python-2.7'
# Linux, GCC 6 coverage build
- os: linux
env: COMPILER_C=gcc-6 COMPILER_CXX=g++-6 CMAKE_OPTIONS="-DUI_CXX_USE_QT=OFF -DSPIRIT_TEST_COVERAGE=ON" PYPI=false COVERAGE=true RUNTESTS=false
compiler: g++
addons:
apt:
packages:
- g++-6
- lcov
- qt57base
- ca-certificates
- python2.7
sources:
- sourceline: 'ppa:ubuntu-toolchain-r/test'
- sourceline: 'ppa:beineri/opt-qt571-trusty'
- sourceline: 'ppa:jonathonf/python-2.7'
# - compiler: clang
# addons:
# apt:
# sources:
# - ubuntu-toolchain-r-test
# - llvm-toolchain-precise-3.6
# packages:
# - clang-3.6
# env: COMPILER=clang++-3.6
# - compiler: clang
# addons:
# apt:
# sources:
# - ubuntu-toolchain-r-test
# - llvm-toolchain-precise-3.7
# packages:
# - clang-3.7
# env: COMPILER=clang++-3.7
before_install:
- sudo pip install numpy wheel twine coveralls
# Run homebrew on osx
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update; fi
# Setup default versions and override compiler if needed
- if [[ "${LLVM_VERSION}" == "default" ]]; then LLVM_VERSION=3.9.0; fi
# Install a recent CMake (unless already installed on OS X)
- |
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR}
CMAKE_URL="http://www.cmake.org/files/v3.5/cmake-3.5.2-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}
export CC=${COMPILER_C} CXX=${COMPILER_CXX}
source /opt/qt57/bin/qt57-env.sh
else
if ! brew ls --version cmake &>/dev/null; then brew install cmake; fi
brew install cppcheck qt
brew link --force qt
export PATH=/usr/local/opt/qt/bin:${PATH}
fi
# Install CUDA
- |
if [[ "$USE_CUDA" == "true" ]]; then
export CUDA=8.0.61-1
# get cuda-repo-ubuntu1404
travis_retry wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/cuda-repo-ubuntu1404_${CUDA}_amd64.deb
travis_retry sudo dpkg -i cuda-repo-ubuntu1404_${CUDA}_amd64.deb
# install
travis_retry sudo apt-get update -qq
export CUDA_APT=${CUDA:0:3}
export CUDA_APT=${CUDA_APT/./-}
travis_retry sudo apt-get install -y cuda-drivers cuda-core-${CUDA_APT} cuda-cudart-dev-${CUDA_APT} cuda-curand-dev-${CUDA_APT} cuda-cufft-dev-${CUDA_APT}
travis_retry sudo apt-get clean
# export
export CUDA_HOME=/usr/local/cuda-${CUDA:0:3}
export LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}
export PATH=${CUDA_HOME}/bin:${PATH}
export CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCMAKE_C_COMPILER=${COMPILER_C} -DCMAKE_CXX_COMPILER=${COMPILER_CXX} -DCUDA_TOOLKIT_ROOT_DIR=${CUDA_HOME}"
ls -a ${CUDA_HOME} ${CUDA_HOME}/bin ${CUDA_HOME}/include
fi
install:
# Build everything
- cd ${TRAVIS_BUILD_DIR}
- |
mkdir -p build
cd build
cmake ${CMAKE_OPTIONS} ..
cd ..
- if [ "$USE_CUDA" != "true" ]; then ./make.sh -j2; else ./make.sh; fi
before_script:
# Test everything
# Do not run this section if flag was set to false
- if [ "$RUNTESTS" != "false" ]; then ./ctest.sh; fi
script:
# Build the python package
- echo "Python package build"
- if [ "$TRAVIS_BRANCH" != "master" ]; then export SPIRIT_ADD_VERSION_SUFFIX=true; else export SPIRIT_ADD_VERSION_SUFFIX=false; fi
- echo "Add suffix to spirit version tag for python package $SPIRIT_ADD_VERSION_SUFFIX"
- cd core/python
- python setup.py sdist bdist_wheel;
# Specify account details for PyPI
- echo "[distutils]" > ~/.pypirc
- echo "index-servers =" >> ~/.pypirc
- echo " testpypi" >> ~/.pypirc
- echo " pypi" >> ~/.pypirc
- echo "[pypi]" >> ~/.pypirc
- echo "repository=https://upload.pypi.org/legacy/" >> ~/.pypirc
- echo "username=$PYPIUSER" >> ~/.pypirc
- echo "password=$PYPIPASSWORD" >> ~/.pypirc
- echo "[testpypi]" >> ~/.pypirc
- echo "repository=https://test.pypi.org/legacy/" >> ~/.pypirc
- echo "username=$PYPIUSER" >> ~/.pypirc
- echo "password=$PYPIPASSWORD" >> ~/.pypirc
# Publish python package
- echo "PYPI deployment:"
- if [ "$PYPI" != "true" ]; then echo "Not going to deploy because not configured to."; fi
# Do not build pull requests
- if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then echo "Not going to deploy because pull request."; fi
- if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then PYPI=false; fi
# Upload to pypi on master commits (if PYPI == true)
- if [ "$PYPI" == "true" ] && [ "$TRAVIS_BRANCH" == "master" ]; then echo "Deploying to pypi because on master branch."; else echo "Not deploying to pypi."; fi
- if [ "$PYPI" == "true" ] && [ "$TRAVIS_BRANCH" == "master" ]; then twine upload --skip-existing -r pypi dist/*; fi
# Upload to testpypi on all commits (if PYPI == true)
- if [ "$PYPI" == "true" ]; then echo "Deploying to testpypi."; else echo "Not deploying to testpypi."; fi
- if [ "$PYPI" == "true" ]; then twine upload --skip-existing -r testpypi dist/*; fi
# Don't run coverage on branches other than master or develop (or pull requests targeting those)
- if [ "$TRAVIS_BRANCH" != "master" ] && [ "$TRAVIS_BRANCH" != "develop" ]; then COVERAGE=false; fi
# Run C++ coverage report generation and upload to codecov
- cd ../../build
- if [ "$COVERAGE" == "true" ]; then lcov -c -i --no-external --directory . --base-directory ../core -o baseline.info; fi
- if [ "$COVERAGE" == "true" ]; then make test; fi
- if [ "$COVERAGE" == "true" ]; then lcov -c --no-external --directory . --base-directory ../core -o after_test.info; fi
- if [ "$COVERAGE" == "true" ]; then lcov -a baseline.info -a after_test.info -o total_test.info; fi
- if [ "$COVERAGE" == "true" ]; then lcov -r total_test.info \*thirdparty\* \*/test/\* \*Collection\* \*DLL_\* -o coverage.info; fi
- if [ "$COVERAGE" == "true" ]; then bash <(curl -s https://codecov.io/bash) -f coverage.info || echo "Codecov did not collect coverage reports"; fi
# Run Python coverage report generation and upload to coveralls
- cd ../core/python
- if [ "$COVERAGE" == "true" ]; then coverage run --source spirit --omit=spirit/spiritlib.py,spirit/collection.py setup.py test > cov.txt; fi
- if [ "$COVERAGE" == "true" ]; then head cov.txt; fi
- if [ "$COVERAGE" == "true" ]; then coverage report -m; fi
- if [ "$COVERAGE" == "true" ]; then coverage xml; fi
- if [ "$COVERAGE" == "true" ]; then coveralls; fi