forked from obspy/obspy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
82 lines (82 loc) · 3.64 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
language: python
python:
- 2.7
- 3.3
- 3.4
sudo: false
install:
- lsb_release -a # get info on the operating system
- if [[ "${TRAVIS_PYTHON_VERSION:0:1}" == '2' ]]; then
wget https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh;
else
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
fi
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- hash -r
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
# Useful for debugging any issues with conda
- conda info -a
# Replace dep1 dep2 ... with your dependencies
- conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION numpy==1.8.2 scipy==0.14.0 matplotlib==1.3.1 basemap==1.0.7 flake8 future lxml sqlalchemy mock nose gdal
- source activate test-environment
# install packages not available via conda
- pip install wheel
- wget -q -O - 'https://github.com/obspy/wheelhouse/archive/master.tar.gz' | tar -C /tmp -xzf -
- pip install --use-wheel --no-index --find-links=/tmp/wheelhouse-master pyproj
- pip install --use-wheel --find-links=/tmp/wheelhouse-master coveralls
- pip install geographiclib
# current pyimgur stable release has a py2.6 incompatibility
- pip install https://github.com/megies/PyImgur/archive/py26.zip
- pip freeze
- conda list
# done installing dependencies
- git version
- git fetch origin --tags --unshallow
- git remote add obspy git://github.com/obspy/obspy.git
- git fetch obspy --tags
- git status
- git branch -vv
- git remote -vv
# try to set correct remote tracking branch (to get branch info in version number of reports at tests.obspy.org)
- |
if [ "$TRAVIS_PULL_REQUEST" != "false" ]
# we're building a pull request, so we need to find out the fork it's coming from through github API
then GITHUB_LABEL=`python -c "from urllib import urlopen; import json; print(json.loads(urlopen(\"https://api.github.com/repos/$TRAVIS_REPO_SLUG/pulls/$TRAVIS_PULL_REQUEST\").read()).get('head').get('label'))"`
export GITHUB_FORK=${GITHUB_LABEL%:*}
export GITHUB_REMOTE=${GITHUB_FORK}/obspy
export GITHUB_BRANCH=${GITHUB_LABEL#*:}
# we're building a branch on the main repo
else export GITHUB_REMOTE=$TRAVIS_REPO_SLUG
export GITHUB_BRANCH=$TRAVIS_BRANCH
export GITHUB_FORK=${TRAVIS_REPO_SLUG%/*}; fi \
&& echo "$GITHUB_REMOTE $GITHUB_FORK $GITHUB_BRANCH" \
&& if [ "$GITHUB_FORK" != "obspy" ]
then git remote add $GITHUB_FORK git://github.com/$GITHUB_REMOTE; fi \
&& git fetch $GITHUB_FORK +refs/heads/$GITHUB_BRANCH \
&& git checkout -b tested_branch \
&& git branch --set-upstream-to=$GITHUB_FORK/$GITHUB_BRANCH \
|| echo
- git branch -vv
- git remote -vv
- pip install --no-deps .
- git status
script:
# We change directories to make sure that python won't find the copy
# of obspy in the source directory, see
# https://github.com/numpy/numpy/blob/master/.travis.yml#L44
- mkdir empty
- cd empty
- MODULELIST=`python -c "from obspy.core.util import DEFAULT_MODULES as MODULES; print('obspy.' + ',obspy.'.join(MODULES))"`
- coverage run --rcfile=.coveragerc --source=$MODULELIST -m obspy.scripts.runtests -n travis-ci -r
after_success:
- mv .coverage ../.coverage.empty
- cd ..
- coverage combine
- coveralls
notifications:
email: false
env:
global:
- secure: "qZzgI89uD606mP/l2IDLFmocZ8YFhXRngtWR1wroirhodKzdg89Qax8+UxkdmAyYKgl4+mLA8ZYMpHtojO2l2v96cOJemf/vhdp3Y+HnIURVwoPnPGXCFdC5SlQe6GB+zGqP7EBSRnsib8aexnHY7WFZAb+DOgpKi2gLs2AZeQo="