-
Notifications
You must be signed in to change notification settings - Fork 3
/
.travis.yml
214 lines (199 loc) · 4.92 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
language: cpp
sudo: true
dist: bionic
# Handle git submodules yourself
git:
submodules: false
# Only run on master
branches:
only:
- master
- develop
addons:
apt:
sources:
- sourceline: "ppa:ubuntu-toolchain-r/test"
packages:
- python3-dev
- python3-pip
- python3-setuptools
- lcov
# Define the build matrix
compiler:
- gcc
- clang
os:
- linux
- mac
- windows
osx_image:
- xcode9.4
- xcode10
- xcode10.3
- xcode11
- xcode11.3
env:
jobs:
- BUILD_TYPE=Debug
- BUILD_TYPE=Release
- BUILD_TYPE=Install
global:
PYTHONPATH: ${TRAVIS_BUILD_DIR}/build/py
PY_CMD: python3
MK_CMD: make
jobs:
# Exclude some jobs on Mac and Windows to reduce total number of builds
exclude:
- os: mac
osx_image: xcode9.4
compiler: gcc
- os: mac
osx_image: xcode10
compiler: gcc
- os: mac
osx_image: xcode10.3
compiler: gcc
- os: mac
osx_image: xcode11
compiler: gcc
- os: mac
env: BUILD_TYPE=Debug
- os: mac
osx_image: xcode9.4
env: BUILD_TYPE=Install
- os: mac
osx_image: xcode10
env: BUILD_TYPE=Install
- os: mac
osx_image: xcode10.3
env: BUILD_TYPE=Install
- os: mac
osx_image: xcode11
env: BUILD_TYPE=Install
- os: windows
env: BUILD_TYPE=Debug
- os: windows
compiler: clang
# Include some additional Mac jobs
include:
- os: osx
osx_image: xcode11.3
compiler: gcc
env:
CC: gcc-9
CXX: g++-9
BUILD_TYPE: Release
- os: osx
osx_image: xcode11.3
compiler: gcc
env:
CC: gcc-9
CXX: g++-9
BUILD_TYPE: Install
- os: osx
osx_image: xcode11.3
compiler: clang
env:
BUILD_TYPE: Install
# Test other versions of GCC and clang
- os: linux
compiler: gcc
env:
CC: gcc-5
CXX: g++-5
BUILD_TYPE: Release
- os: linux
compiler: gcc
env:
CC: gcc-6
CXX: g++-6
BUILD_TYPE: Release
- os: linux
compiler: gcc
env:
CC: gcc-8
CXX: g++-8
BUILD_TYPE: Release
- os: linux
compiler: gcc
env:
CC: gcc-9
CXX: g++-9
BUILD_TYPE: Release
- os: linux
compiler: clang
env:
CC: clang-3.9
CXX: clang++-3.9
BUILD_TYPE: Release
- os: linux
compiler: clang
env:
CC: clang-4.0
CXX: clang++-4.0
BUILD_TYPE: Release
- os: linux
compiler: clang
env:
CC: clang-5.0
CXX: clang++-5.0
BUILD_TYPE: Release
- os: linux
compiler: clang
env:
CC: clang-6.0
CXX: clang++-6.0
BUILD_TYPE: Release
- os: linux
compiler: clang
env:
CC: clang-8
CXX: clang++-8
BUILD_TYPE: Release
- os: linux
compiler: clang
env:
CC: clang-9
CXX: clang++-9
BUILD_TYPE: Release
# Use sed to replace the SSH URL with the public URL, then initialize submodules
before_install:
- sed -i.bak 's/git@github.com:/https:\/\/github.com\//' .gitmodules
- |
if [ ${TRAVIS_OS_NAME} == "windows" ]
then
choco install python
export PATH=/c/Users/travis/AppData/Roaming/Python/Python38/Scripts:/c/ProgramData/chocolatey/bin:/c/Python38:/c/Python38/Scripts:$PATH
export PY_CMD=/c/Python38/python.exe
export MK_CMD=mingw32-make
PY_EXE_PATH=${PY_CMD}
PY_LIB_PATH=/c/Python38/python38.dll
PY_INC_PATH=/c/Python38/include
export CMAKE_GENERATOR="MSYS Makefiles"
export WINDOWS_CMAKE_ARGS="-DCMAKE_MAKE_PROGRAM=${MK_CMD} -DPYTHON_EXECUTABLE=${PY_EXE_PATH} -DPYTHON_LIBRARY=${PY_LIB_PATH} -DPYTHON_INCLUDE_DIR=${PY_INC_PATH}"
fi
- if [ ${TRAVIS_OS_NAME} == "linux" ]; then pyenv global 3.8.1; fi
- git submodule update --init --recursive
- $PY_CMD -m pip install --user --upgrade pip wheel setuptools
install:
- $PY_CMD -m pip install --user -r requirements.dev.txt
- $PY_CMD -m pip install --user -r requirements.txt
- ${CXX} --version || sudo apt-get install ${CXX}
script:
- cd ${TRAVIS_BUILD_DIR}
- ./.travis_script.sh
after_success:
# Skip this unless on a debug build
- if [ ${BUILD_TYPE} != "Debug" ]; then exit 0; fi
- if [ ${TRAVIS_OS_NAME} != "linux" ]; then exit 0; fi
- cd ${TRAVIS_BUILD_DIR}/build_coverage
# Capture coverage info
- lcov --directory . --capture --output-file coverage.info
# Filter out system libraries and dependencies
- lcov --remove coverage.info '/usr/*' --output-file coverage.info
- lcov --remove coverage.info '${TRAVIS_BUILD_DIR}/thirdparty/*' --output-file coverage.info
# Print coverage stats to the screen, for debug purposes
- lcov --list coverage.info
- $PY_CMD -m coverage report
# Upload report to CodeCov
- bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports"