forked from airspeed-velocity/asv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
109 lines (97 loc) · 3.29 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
language: python
sudo: false
env:
global:
- USE_CONDA=false
- COVERAGE=""
python:
- 2.7
- 3.4
- 3.5
- 3.6
- pypy
# - pypy3
addons:
firefox: "61.0.1"
matrix:
include:
- python: 2.7
env:
- USE_CONDA=true
- COVERAGE="--cov=asv --cov=test"
- python: 3.6
env: USE_CONDA=true
- python: 2.7
env:
- PYFLAKES=1
install:
- pip install pyflakes
script:
- |
set +e
SKIP="unable to detect undefined names"
SKIP="$SKIP|assigned to but never used"
SKIP="$SKIP|imported but unused"
SKIP="$SKIP|redefinition of unused"
SKIP="$SKIP|test/test_repo_template/asv_test_repo/__init__.py"
SKIP="$SKIP|asv/extern/asizeof.py"
SKIP="$SKIP|asv/benchmark.py.*undefined name .(run|params)."
PYFLAKES_NODOCTEST=1 pyflakes asv test | grep -E -v "$SKIP" > test.out; cat test.out; test \! -s test.out
cache:
directories:
- $HOME/.cache/pip
- $HOME/download
before_install:
- |
# Install Webdriver backend for Firefox:
set -e
mkdir -p $HOME/download
pushd $HOME/download
wget -nc https://github.com/mozilla/geckodriver/releases/download/v0.19.1/geckodriver-v0.19.1-linux64.tar.gz
mkdir $HOME/geckodriver
tar -xzf geckodriver-v0.19.1-linux64.tar.gz -C $HOME/geckodriver
popd
export PATH="$PATH:$HOME/geckodriver"
install:
- |
set -e
export TRAVIS_PYTHON=`which python`
export TRAVIS_PIP=`which pip`
if [[ $USE_CONDA == true ]]; then
mkdir -p $HOME/download;
export MINICONDA_SH="Miniconda3-4.3.30-Linux-x86_64.sh";
pushd $HOME/download;
wget -N https://repo.continuum.io/miniconda/$MINICONDA_SH;
chmod +x $MINICONDA_SH;
./$MINICONDA_SH -b;
popd;
export PATH=$HOME/miniconda3/bin:$PATH;
conda update --yes conda;
conda info
. $HOME/miniconda3/etc/profile.d/conda.sh # enable conda bash function
mv $HOME/miniconda3/bin/conda $HOME/miniconda3/bin/conda.real;
echo -e '#!/bin/bash\n' > $HOME/miniconda3/bin/conda;
declare -f travis_retry >> $HOME/miniconda3/bin/conda;
echo -e '\ntravis_retry "$HOME/miniconda3/bin/conda.real" "$@"' >> $HOME/miniconda3/bin/conda;
chmod +x $HOME/miniconda3/bin/conda;
if $TRAVIS_PYTHON -c 'import virtualenv'; then echo "ERROR: virtualenv package is installed"; exit 1; fi;
$TRAVIS_PYTHON .continuous-integration/download_reqs.py --conda --pip=$HOME/download/pip-cache
else
if $TRAVIS_PYTHON -c 'import sys; sys.exit(0 if "__pypy__" in sys.modules else 1)'; then
$TRAVIS_PIP install virtualenv;
else
$TRAVIS_PIP install virtualenv numpy scipy;
fi
$TRAVIS_PYTHON .continuous-integration/download_reqs.py --pip=$HOME/download/pip-cache
fi
$TRAVIS_PIP install selenium six "pytest>=3.5" pytest-xdist pytest-rerunfailures feedparser python-hglib;
if [[ "$COVERAGE" != '' ]]; then $TRAVIS_PIP install pytest-cov codecov; fi;
- $TRAVIS_PYTHON setup.py build_ext -i
- export PIP_FIND_LINKS=file://$HOME/download/pip-cache
script:
- $TRAVIS_PYTHON -m pytest -l $COVERAGE -vv --webdriver=FirefoxHeadless -n 3 --offline test
after_script:
- if [[ "$COVERAGE" != '' ]]; then
$TRAVIS_PYTHON -m coverage xml;
codecov;
fi