forked from CastXML/pygccxml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
257 lines (237 loc) · 8.76 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
251
252
253
254
255
256
257
language:
- python
env:
global:
- WINDOWS=0
- SITECUSTOMIZELIBPATH=0
- PYPY=0
dist: trusty
matrix:
include:
- os: linux
# BUILD 1 -------------------
python: 3.6
env: WINDOWS=1
- os: linux
# BUILD 2 -------------------
python: 2.7
env:
# gcc 4.8.4 with c++98
- XML_GENERATOR="castxml"
- SITECUSTOMIZELIBPATH="/home/travis/virtualenv/python2.7/lib/python2.7/sitecustomize.py"
- os: linux
# BUILD 3 -------------------
python: 3.4
env:
# gcc 4.8.4 with c++98
- XML_GENERATOR="castxml"
- SITECUSTOMIZELIBPATH="/home/travis/virtualenv/python3.4/lib/python3.4/sitecustomize.py"
- os: linux
# BUILD 4 -------------------
python: 3.5
env:
# gcc 4.8.4 with c++98
- XML_GENERATOR="castxml"
- SITECUSTOMIZELIBPATH="/home/travis/virtualenv/python3.5/lib/python3.5/sitecustomize.py"
- os: linux
# BUILD 5 -------------------
python: 3.6
env:
# gcc 4.8.4 with c++98
- XML_GENERATOR="castxml"
- SITECUSTOMIZELIBPATH="/home/travis/virtualenv/python3.6/lib/python3.6/sitecustomize.py"
- os: linux
# BUILD 6 -------------------
python: pypy
env:
# gcc 4.8.4 with c++98
- XML_GENERATOR="castxml"
- SITECUSTOMIZELIBPATH="/home/travis/virtualenv/pypy/lib-python/2.7/sitecustomize.py"
- PYPY=1
- os: linux
# BUILD 7 -------------------
python: pypy3
env:
# gcc 4.8.4 with c++98
- XML_GENERATOR="castxml"
- SITECUSTOMIZELIBPATH="/home/travis/virtualenv/pypy3/lib-python/3/sitecustomize.py"
- PYPY=1
- os: linux
# BUILD 8 -------------------
python: 3.6
env:
# gcc 5.4.1 with c++98
- XML_GENERATOR="castxml"
- COMPILER=g++-5
- SITECUSTOMIZELIBPATH="/home/travis/virtualenv/python3.6/lib/python3.6/sitecustomize.py"
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-5
- os: linux
# BUILD 9 ------------------
python: 3.6
env:
- XML_GENERATOR="castxml"
- SITECUSTOMIZELIBPATH="/home/travis/virtualenv/python3.6/lib/python3.6/sitecustomize.py"
- os: linux
# BUILD 10 ------------------
python: 3.6
env:
# gcc 4.8.4 with c++03
- XML_GENERATOR="castxml"
- CPPSTD="-std=c++03"
- SITECUSTOMIZELIBPATH="/home/travis/virtualenv/python3.6/lib/python3.6/sitecustomize.py"
- os: linux
# BUILD 11 ------------------
python: 3.6
env:
# gcc 4.8.4 with c++11
- XML_GENERATOR="castxml"
- CPPSTD="-std=c++11"
- SITECUSTOMIZELIBPATH="/home/travis/virtualenv/python3.6/lib/python3.6/sitecustomize.py"
- os: linux
# BUILD 12 ------------------
python: 3.6
env:
# gcc 5.4.1 with c++11
- XML_GENERATOR="castxml"
- COMPILER=g++-5
- CPPSTD="-std=c++11"
- SITECUSTOMIZELIBPATH="/home/travis/virtualenv/python3.6/lib/python3.6/sitecustomize.py"
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-5
- os: linux
# BUILD 13 ------------------
python: 3.6
env:
# gcc 5.4.1 with c++14
- XML_GENERATOR="castxml"
- COMPILER=g++-5
- CPPSTD="-std=c++14"
- SITECUSTOMIZELIBPATH="/home/travis/virtualenv/python3.6/lib/python3.6/sitecustomize.py"
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-5
- os: osx
# BUILD 14 ------------------
osx_image: xcode9.4
language: generic
env:
- XML_GENERATOR="castxml"
- TRAVIS_PYTHON_VERSION="2"
- SITECUSTOMIZELIBPATH="/usr/local/lib/python2.7/site-packages/sitecustomize.py"
- os: osx
# BUILD 15 ------------------
osx_image: xcode9.4
language: generic
env:
- XML_GENERATOR="castxml"
- TRAVIS_PYTHON_VERSION="3"
- SITECUSTOMIZELIBPATH="/usr/local/lib/python3.6/site-packages/sitecustomize.py"
- os: linux
# BUILD 16 ------------------
python: 3.6
env:
- XML_GENERATOR="castxml-18032017"
- SITECUSTOMIZELIBPATH="/home/travis/virtualenv/python3.6/lib/python3.6/sitecustomize.py"
- os: linux
# BUILD 17 ------------------
python: 3.6
env:
- XML_GENERATOR="castxml-18032017"
- CASTXML_EPIC="1"
- SITECUSTOMIZELIBPATH="/home/travis/virtualenv/python3.6/lib/python3.6/sitecustomize.py"
before_install:
# OS X
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then travis_retry brew update && brew upgrade; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ $TRAVIS_PYTHON_VERSION == 2 ]]; then brew install python@2; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ $TRAVIS_PYTHON_VERSION == 3 ]]; then brew install python; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ $TRAVIS_PYTHON_VERSION == 3 ]]; then sudo ln -sf /usr/local/bin/pip3 /usr/local/bin/pip; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ $TRAVIS_PYTHON_VERSION == 3 ]]; then sudo ln -sf /usr/local/bin/python3 /usr/local/bin/python; fi
# Download castxml binaries
# To update the URLs, get the full URLS from ITK, and the run wget with --verbose on the URL.
# Look at the redirection and extract the direct URL for usage with Travis.
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then
if [ ! -e ${HOME}/castxml ]; then
wget -q -O - https://midas3.kitware.com/midas/download/bitstream/461589/castxml-macosx.tar.gz | tar zxf - -C ${HOME};
fi;
fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ $XML_GENERATOR == "castxml" ]]; then
if [ ! -e ${HOME}/castxml ]; then
wget -q -O - https://midas3.kitware.com/midas/download/bitstream/461590/castxml-linux.tar.gz | tar zxf - -C ${HOME};
fi;
fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ $XML_GENERATOR == "castxml-18032017" ]]; then
if [ ! -e ${HOME}/castxml ]; then
wget -q -O - https://sourceforge.net/projects/pygccxml-castxml-binaries/files/castxml-linux-18032017.tar.gz | tar zxf - -C ${HOME};
fi;
fi
# Add the castxml binary to the path
- if [[ $XML_GENERATOR == "castxml" ]] || [[ $XML_GENERATOR == "castxml-18032017" ]]; then
export PATH=$PATH:~/castxml/bin/;
fi
- if [[ $CPPSTD == "-std=c++03" ]]; then
mv unittests/configs/travis_std03.cfg unittests/xml_generator.cfg;
fi
- if [[ $CPPSTD == "-std=c++11" ]]; then
mv unittests/configs/travis_std11.cfg unittests/xml_generator.cfg;
fi
- if [[ $CPPSTD == "-std=c++14" ]]; then
mv unittests/configs/travis_std14.cfg unittests/xml_generator.cfg;
fi
- if [[ "$COMPILER" == "g++-5" ]] && [[ $XML_GENERATOR == "castxml" ]]; then
mv unittests/configs/travis_gcc5.cfg unittests/xml_generator.cfg;
fi
- if [[ $CASTXML_EPIC == "1" ]]; then
mv unittests/configs/castxml_epic1.cfg unittests/xml_generator.cfg;
fi
- pip install coveralls
- if [[ $WINDOWS == 0 ]]; then pip install coverage; fi
# appveyor-artifacts will be used to fetch coverage results from appveyor
- if [ $WINDOWS == 0 ]; then
pip install pycodestyle;
else
pip install https://github.com/Robpol86/appveyor-artifacts/archive/master.zip;
fi
script:
- echo $TRAVIS_OS_NAME
- echo $WINDOWS
- python --version
- c++ --version
# Modify sitecustomize.py file for coverage. Allows to cover files run in a subprocess.
- if [ $WINDOWS == 0 ]; then
touch ${SITECUSTOMIZELIBPATH} || travis_terminate 1;
printf "import coverage\ncoverage.process_startup()\n" > ${SITECUSTOMIZELIBPATH} || travis_terminate 1;
fi
# Install pygccxml, run the tests with coverage and
# combine multiple .coverage files
# We have multiple coverage files because some scripts run in a subprocess
- if [[ $WINDOWS == 0 ]] && [[ $PYPY == 0 ]]; then
python setup.py install || travis_terminate 1;
coverage run -m unittests.test_all || travis_terminate 1;
coverage combine || travis_terminate 1;
fi
# For pypy, do not run coverage, as this is extremely slow
# https://bitbucket.org/pypy/pypy/issues/1871/10x-slower-than-cpython-under-coverage
# This is fixed with pypy 4.0, which is not the pypy provided by Travis ...
- if [[ $WINDOWS == 0 ]] && [[ $PYPY != 0 ]]; then
python setup.py install || travis_terminate 1;
python -m unittests.test_all || travis_terminate 1;
fi
# For the "empty" windows build, fetch the coverage results from appveyor
- if [ $WINDOWS == 1 ]; then
appveyor-artifacts -m --owner-name=iMichka --verbose download || travis_terminate 1;
fi
after_success:
# Send coverage result to https://coveralls.io/r/gccxml/pygccxml
- coveralls