forked from vispy/vispy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
199 lines (181 loc) · 7.34 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
language: python
dist: xenial
addons:
apt:
packages:
- &mesa_apt [libgl1-mesa-dri]
- &full_apt [libgl1-mesa-dri, libegl1-mesa, cmake, xorg-dev, libglu1-mesa-dev, mercurial, libdbus-1-dev, libgl1-mesa-dev, libglu1-mesa-dev, libpulse-dev, libx11-dev, libxcursor-dev, libxext-dev, libxi-dev, libxinerama-dev, libxrandr-dev, libxss-dev, libxt-dev, libxv-dev, libxxf86vm-dev, libasound2-dev, libudev-dev, libsdl2-2.0-0]
# full_apt should also have 'libts-dev' but it is not available on xenial
# liblgfw2 is not whitelisted by Travis, so we don't try using it here (not usable anyway)
# Size testing can be skipped by adding "[size skip]" within a commit message.
matrix:
include:
- env: PYTHON=3.7 DEPS=minimal TEST=standard
os: osx
language: generic
osx_image: xcode10.1
- env: PYTHON=3.7 DEPS=full TEST=standard
os: osx
language: generic
osx_image: xcode10.1
# Travis Examples are extremely slow for OSX (times out)
# - env: PYTHON=3.7 DEPS=full TEST=examples
# os: osx
# language: generic
- env: PYTHON=3.7 DEPS=minimal TEST=standard # also tests file sizes, style, line endings
addons:
apt:
packages:
- env: PYTHON=3.7 DEPS=full TEST=standard
addons:
apt:
packages:
- *mesa_apt
- *full_apt
- env: PYTHON=3.7 DEPS=full TEST=examples # test examples
addons:
apt:
packages:
- *mesa_apt
- *full_apt
- env: PYTHON=2.7 DEPS=full TEST=standard
addons:
apt:
packages:
- *mesa_apt
- *full_apt
# OSMesa requires a specific Travis run because since the system also
# has (on-screen) OpenGL installed, we need to setup environment variable
# to avoid having the linker load the wrong libglapi.so which would cause
# OSMesa to crash
- env: PYTHON=3.7 DEPS=osmesa TEST=osmesa
addons:
apt:
packages:
before_install:
- if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
wget -q http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh;
else
wget -q http://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh;
fi;
- chmod +x miniconda.sh
- ./miniconda.sh -b -p ~/anaconda
- export PATH=~/anaconda/bin:$PATH
- conda config --add channels conda-forge
- conda update --yes --quiet conda
# Set strict channel priority
- conda config --set channel_priority strict
- SRC_DIR=$(pwd)
# file size checks run on minimal build for time
- if [ "${DEPS}" == "minimal" ]; then
if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then
GIT_TARGET_EXTRA="+refs/heads/${TRAVIS_BRANCH}";
GIT_SOURCE_EXTRA="+refs/pull/${TRAVIS_PULL_REQUEST}/merge";
else
GIT_TARGET_EXTRA="";
GIT_SOURCE_EXTRA="";
fi;
cd ~;
mkdir target-size-clone && cd target-size-clone;
git init && git remote add -t ${TRAVIS_BRANCH} origin git://github.com/${TRAVIS_REPO_SLUG}.git;
git fetch origin ${GIT_TARGET_EXTRA} && git checkout -qf FETCH_HEAD;
git tag travis-merge-target;
git gc --aggressive;
TARGET_SIZE=`du -s . | sed -e "s/[[:space:]].*//"`;
git pull origin ${GIT_SOURCE_EXTRA};
git gc --aggressive;
MERGE_SIZE=`du -s . | sed -e "s/[[:space:]].*//"`;
if [ "${MERGE_SIZE}" != "${TARGET_SIZE}" ]; then
SIZE_DIFF=`expr \( ${MERGE_SIZE} - ${TARGET_SIZE} \)`;
else
SIZE_DIFF=0;
fi;
fi;
install:
# create basic conda-forge environment
- conda create -n testenv --yes --quiet pip python=$PYTHON;
- source activate testenv;
# add needed packages common to all backends/tests
- conda install --yes --quiet numpy scipy nose pytest cython coveralls pytest-cov pytest-sugar pytest-faulthandler flake8;
# On Python3, install system-wide copies of bundled libraries instead
# Also install PyQt5, imaging (PIL or pillow), scipy, mpl, egl
# wxpython available from conda-forge but not for OSX:
# https://github.com/conda-forge/wxpython-feedstock/issues/2
# Don't test pyside2 because it seems to segfault on travis
# If we only need a single backend (DEPS=backend), then use PyQT5
# Don't test Pyglet because it currently segfaults (but AppVeyor checks it)
# WX requires OSMesa (mesa on conda) which has typically been an
# additional test environment. With llvm=3.3 the combination of
# EGL and mesa causes segmentation faults. See issue #1401.
# can remove the github numpydoc install once >0.8.0 is released and get it from conda
- if [ "${DEPS}" == "full" ]; then
conda install --yes pyopengl networkx pysdl2;
pip install numpydoc;
if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
conda install --yes matplotlib jupyter pyqt=5 pillow decorator six scikit-image glfw;
if [ "${PYTHON}" == "3.7" ]; then
conda install --yes freetype-py imageio "freetype<2.10.0";
pip install -q husl pypng cassowary;
rm -rf ${SRC_DIR}/vispy/ext/_bundled;
else
conda install --yes mock;
fi;
else
conda install --yes matplotlib jupyter pyqt=5 scikit-image mock;
fi;
fi;
# Install OSMesa
- if [ "${DEPS}" == "osmesa" ]; then
conda install --yes mesalib libglu;
fi;
# Install vispy
- cd ${SRC_DIR}
- python setup.py install
- python setup.py develop
- cd ~
before_script:
# We need to create a (fake) display on Travis, let's use a funny resolution
# For OSX: https://github.com/travis-ci/travis-ci/issues/7313#issuecomment-279914149
- if [ "${TEST}" != "osmesa" ]; then
export DISPLAY=:99.0;
if [ "${TRAVIS_OS_NAME}" = "osx" ]; then ( sudo Xvfb :99 -ac -screen 0 1400x900x24 +render +iglx; echo ok )& fi;
if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1400x900x24 -ac +extension GLX +render;
fi;
fi;
- if [ "${TEST}" == "osmesa" ]; then
export OSMESA_LIBRARY=$CONDA_PREFIX/lib/libOSMesa32.so;
fi;
script:
- cd ${SRC_DIR}
- python -c "import vispy; print(vispy.sys_info())"
- if [ "${TEST}" == "standard" ]; then
make unit;
fi;
- if [ "${TEST}" == "examples" ] || [ "${DEPS}" == "minimal" ]; then
make examples;
fi;
- if [ "${DEPS}" == "minimal" ]; then
make extra;
fi;
- if [ "${TEST}" == "osmesa" ]; then
make osmesa;
fi;
# Each line must be run in a separate line to ensure exit code accuracy
- if [ "${DEPS}" == "minimal" ]; then
echo "Size difference ${SIZE_DIFF} kB";
if git log --format=%B -n 2 | grep -q "\[size skip\]"; then
echo "Skipping size test";
elif git log --format=%B -n 2 | grep -q "\[skip size\]"; then
echo "Skipping size test";
else
test ${SIZE_DIFF} -lt 100;
fi;
fi;
after_success:
# Need to run from source dir to execute appropriate "git" commands
- if [ "${TEST}" == "standard" ]; then
COVERAGE_FILE=.vispy-coverage coverage combine;
mv .vispy-coverage .coverage;
coveralls;
fi;