forked from imageio/imageio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
164 lines (150 loc) · 4.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
# Travis CI configuration file for imageio
language: python
addons:
apt:
packages:
- libfreeimage3
- ffmpeg
# Only run travis build on push for master branch
branches:
only:
- master
# Cache image data
cache:
- pip
- directories:
- $HOME/.imageio/images
matrix:
include:
# One runner for style stuff
- os: linux
python: "3.6"
env: TEST_UNIT=0 TEST_STYLE=1
# Special OS'es / interpreters
- os: windows
language: bash
env: TEST_UNIT=1
# The main tests run on Linux for a all relevant Python versions.
- os: linux
python: "3.5"
env: TEST_UNIT=1 TEST_INSTALL=0
- os: linux
python: "3.5"
arch: arm64
env: TEST_UNIT=1 TEST_INSTALL=0
# NOTE -------------------------/\ turned off for now
- os: linux
python: "3.6"
env: TEST_UNIT=1 TEST_COVER=1
- os: linux
python: "3.6"
arch: arm64
env: TEST_UNIT=1 TEST_COVER=1
- os: linux
dist: xenial
sudo: true
python: "3.7"
env: TEST_UNIT=1 TEST_FULL=1
- os: linux
dist: xenial
arch: arm64
sudo: true
python: "3.7"
env: TEST_UNIT=1 #Skipping few tests ("TEST_FULL=1")as it uses "simpleitk" which is taking too long to build.
- os: linux
dist: xenial
sudo: true
python: "3.8-dev"
env: TEST_UNIT=1
- os: linux
dist: xenial
arch: arm64
sudo: true
python: "3.8-dev"
env: TEST_UNIT=1
allow_failures:
# future compatibility is nice,
# but a failure here shouldn't break the build until released
- python: "3.8-dev"
before_install:
- REDIRECT_TO=/dev/stdout # change to /dev/null to silence Travis
- SRC_DIR=$(pwd)
# file size checks
- if [ "${TEST_STYLE}" == "1" ]; 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 &> ${REDIRECT_TO} && git remote add -t ${TRAVIS_BRANCH} origin git://github.com/${TRAVIS_REPO_SLUG}.git &>${REDIRECT_TO};
git fetch origin ${GIT_TARGET_EXTRA} &> ${REDIRECT_TO} && git checkout -qf FETCH_HEAD &> ${REDIRECT_TO} && cd ..;
TARGET_SIZE=`du -s target-size-clone | sed -e "s/\t.*//"`;
mkdir source-size-clone && cd source-size-clone;
git init &> ${REDIRECT_TO} && git remote add -t ${TRAVIS_BRANCH} origin git://github.com/${TRAVIS_REPO_SLUG}.git &> ${REDIRECT_TO};
git fetch origin ${GIT_SOURCE_EXTRA} &> ${REDIRECT_TO} && git checkout -qf FETCH_HEAD &> ${REDIRECT_TO} && cd ..;
SOURCE_SIZE=`du -s source-size-clone | sed -e "s/\t.*//"`;
if [ "${SOURCE_SIZE}" != "${TARGET_SIZE}" ]; then
SIZE_DIFF=`expr ${SOURCE_SIZE} - ${TARGET_SIZE}`;
else
SIZE_DIFF=0;
fi;
fi;
- cd ${SRC_DIR}
install:
# Special stuff for Windows and Legacy Python
- if [ "$TRAVIS_OS_NAME" = "windows" ]; then
choco install python3;
export PATH=/c/Python38:/c/Python38/Scripts:/c/Python37:/c/Python37/Scripts:$PATH;
else
pip install --upgrade pip;
fi;
# Install dependencies depending on ENV
- pip install invoke
- invoke clean
- if [ "${TEST_UNIT}" == "1" ]; then
pip install -q --upgrade imageio-ffmpeg;
pip install -q numpy==1.15 pillow psutil coveralls;
pip install -q --upgrade pytest pytest-cov;
fi;
- if [ "${TEST_STYLE}" == "1" ]; then
pip install -q black flake8 sphinx numpydoc;
fi;
# Install optional dependencies
# We do NOT conda install gdal, because it causes segfaults
- if [ "${TEST_FULL}" == "1" ]; then
pip install simpleitk astropy;
fi;
# Install imageio on one/some env
- if [ "${TEST_INSTALL}" == "1" ]; then
python setup.py build_with_fi install;
fi;
before_script:
script:
- python -c "import sys; print(sys.version, '\n', sys.prefix)";
# Run unit tests or style test
- if [ "${TEST_STYLE}" == "1" ]; then
echo "Size difference ${SIZE_DIFF} kB";
test ${SIZE_DIFF} -lt 100;
fi;
- if [ "${TEST_STYLE}" == "1" ]; then
invoke docs --clean --build;
fi;
- if [ "${TEST_STYLE}" == "1" ]; then
invoke test --style;
elif [ "${TEST_INSTALL}" == "1" ]; then
invoke test --installed;
else
invoke test --unit;
fi;
after_success:
- echo == ALL TESTS PASS ==
- if [ "${TEST_COVER}" == "1" ]; then
coveralls;
fi;
after_failure:
- echo == FAILURE ==
after_script: