forked from astropy/astropy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
216 lines (180 loc) · 7.06 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
# We set the language to c because python isn't supported on the MacOS X nodes
# on Travis. However, the language ends up being irrelevant anyway, since we
# install Python ourselves using conda.
language: c
compiler: gcc
# Cache can be cleared from the travis settings menu, see docs currently at
# https://docs.travis-ci.com/user/caching#Clearing-Caches
cache:
- ccache
os:
- linux
stage: Comprehensive tests
# We need a full clone to make sure setuptools_scm works properly
git:
depth: false
# Setting sudo to false opts in to Travis-CI container-based builds.
sudo: false
addons:
apt:
packages:
# We include the german language pack because we use the
# de_DE locale in some of the io.ascii tests.
- language-pack-de
# tzdata is included to ensure system leap seconds are up to date.
- tzdata
env:
global:
# Set defaults to avoid repeating in most cases
# The following three variables are for tox. TOXENV is a standard
# variable that tox uses to determine the environment to run,
# TOXARGS are arguments passed to tox, and TOXPOSARGS are arguments
# that tox passes through to the {posargs} indicator in tox.ini.
# The latter can be used for example to pass arguments to pytest.
- TOXENV='test'
- TOXARGS='-v'
- TOXPOSARGS=''
# The following is needed to avoid issues if e.g. Matplotlib tries
# to open a GUI window.
- SETUP_XVFB=True
stages:
# Do the style check and a single test job, don't proceed if it fails
- name: Initial tests
# Do the rest of the tests
- name: Comprehensive tests
- name: Final tests
- name: Cron tests
if: type = cron
matrix:
# Don't wait for allowed failures
fast_finish: true
include:
# Try MacOS X.
- os: osx
name: Python 3.7 with all optional dependencies
stage: Cron tests
env: PYTHON_VERSION=3.7
TOXENV="py37-test-alldeps"
TOXPOSARGS="--remote-data=astropy"
CONDA_DEPENDENCIES="clang"
CCOMPILER=clang
# Try all python versions and Numpy versions. Since we can assume that
# the Numpy developers have taken care of testing Numpy with different
# versions of Python, we can vary Python and Numpy versions at the same
# time.
# For the Numpy 1.16 build we use oldestdeps not numpy116 since we can check
# the oldest version of all dependencies where this is known. We also check
# that tests do not open and leave open any files. This has a performance
# impact on running the tests, hence why it is not enabled by default.
- language: python
python: 3.6
name: Python 3.6 with oldest supported version of all dependencies
env: TOXENV="py36-test-oldestdeps"
TOXPOSARGS="--open-files"
# Now try with all optional dependencies.
- language: python
python: 3.6
name: Python 3.6 with all optional dependencies
stage: Initial tests
env: TOXENV="py36-test-alldeps"
TOXPOSARGS="--durations=50""
compiler: clang
# Full tests with coverage checks.
- language: python
python: 3.7
name: Python 3.7 with all optional dependencies and coverage
env: TOXENV="py37-test-alldeps-cov"
TOXPOSARGS="--remote-data=astropy"
LC_CTYPE=C.ascii LC_ALL=C
# Try on Windows
# NOTE: Can't use Numpy 1.18 until Issue 9871 is resolved
- os: windows
stage: Final tests
name: Python 3.7 with all optional dependencies
env: PYTHON_VERSION=3.7
TOXENV='py37-test-alldeps'
# Do a PEP8/pyflakes test with flake8
- language: python
python: 3.7
name: Code style checks
stage: Initial tests
env: TOXENV='codestyle'
# Try developer version of Numpy with optional dependencies and also
# run all remote tests. Since both cases will be potentially
# unstable, we combine them into a single unstable build that we can
# mark as an allowed failure below.
- language: python
python: 3.7
name: Python 3.7 with remote data and dev version of key dependencies
stage: Final tests
env: TOXENV="py37-test-devdeps"
TOXPOSARGS="--remote-data=any"
# We check numpy-dev also in a job that only runs from cron, so that
# we can spot issues sooner. We do not use remote data here, since
# that gives too many false positives due to URL timeouts.
# We also install all dependencies via pip here so we pick up the latest
# releases.
- language: python
python: 3.7
name: Python 3.7 with dev version of key dependencies
stage: Cron tests
env: TOXENV="py37-test-devdeps"
# Run documentation link check in a cron job.
# Was originally in CircleCI doc build but links are too flaky, so
# we moved it here instead.
- language: python
python: 3.7
name: Documentation link check
stage: Cron tests
env: TOXENV='linkcheck'
addons:
apt:
packages:
- graphviz
# Testing with Travis provided Python3.8.
- language: python
dist: xenial
python: 3.8
name: Python 3.8 with required dependencies
stage: Final tests
env: TOXENV='py38-test'
allow_failures:
- language: python
python: 3.7
name: Python 3.7 with remote data and dev version of key dependencies
stage: Final tests
env: TOXENV="py37-test-devdeps"
TOXPOSARGS="--remote-data=any"
before_install:
# We need to use CCOMPILER otherwise Travis overwrites CC if we define it
# in env: above.
- if [ ! -z $CCOMPILER ]; then
export CC=$CCOMPILER;
fi
# Check CC variable
- echo "CC="$CC
# Write configuration items to standard location to make sure they are
# ignored (the tests will fail if not)
- mkdir -p $HOME/.astropy/config/
- printf "unicode_output = True\nmax_width = 500" > $HOME/.astropy/config/astropy.cfg
- if [[ $TOXENV == *-cov ]]; then
export TOXPOSARGS=$TOXPOSARGS" --cov-report=xml:"$TRAVIS_BUILD_DIR"/coverage.xml";
fi
- echo "TOXENV="$TOXENV
- echo "TOXARGS="$TOXARGS
- echo "TOXPOSARGS="$TOXPOSARGS
install:
# language: python is only available for Linux, so for other platforms
# we need to use ci-helpers to set up Python.
- if [[ $TRAVIS_OS_NAME == osx || $TRAVIS_OS_NAME == windows ]]; then
git clone git://github.com/astropy/ci-helpers.git;
source ci-helpers/travis/setup_conda.sh;
fi
script:
- pip install tox
- tox $TOXARGS -- $TOXPOSARGS
after_success:
- if [[ $TOXENV == *-cov ]]; then
pip install codecov;
codecov --gcov-glob "*cextern*";
fi