-
Notifications
You must be signed in to change notification settings - Fork 6
/
.travis.yml
109 lines (106 loc) · 3.81 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: generic
branches:
except:
- arve2
env:
global:
- ENCRYPTION_LABEL: "d0a57c2d09c2"
- COMMIT_AUTHOR_EMAIL: "[email protected]"
- BUILD_DOCS: false
- ONLINE_TESTS: false
matrix:
include:
- env: BUILD_DOCS=true
PYTHON_VERSION=2.7
os: linux
- env: PYTHON_VERSION=3.7
ONLINE_TESTS=true
os: linux
- env: PYTHON_VERSION=2.7
os: osx
- env: PYTHON_VERSION=3.7
os: osx
services:
- postgresql
addons: # install gfortran
apt:
packages:
- gfortran
before_install:
- "brew install gcc || brew link --overwrite gcc || :"
install:
# select the os name for the conda installer
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
OS_NAME=MacOSX;
else
OS_NAME=Linux;
fi
# We do this conditionally because it saves us some downloading if the
# version is the same.
- if [[ "$PYTHON_VERSION" == "2.7" ]]; then
wget https://repo.continuum.io/miniconda/Miniconda2-latest-"${OS_NAME}"-x86_64.sh -O miniconda.sh;
else
wget https://repo.continuum.io/miniconda/Miniconda3-latest-"${OS_NAME}"-x86_64.sh -O miniconda.sh;
fi
# set build_docs to the real value
- if [[ "$BUILD_DOCS" == "true" && "$TRAVIS_PULL_REQUEST" == "false" && ("$TRAVIS_BRANCH" == "master" || "$TRAVIS_TAG" != "") ]]; then
export BUILD_DOCS="true";
else
export BUILD_DOCS="false";
fi
- echo "$BUILD_DOCS"
# make sure we use an 'innocent' default matplotlib environment
- touch matplotlibrc
- bash miniconda.sh -b -p $HOME/miniconda
- . $HOME/miniconda/etc/profile.d/conda.sh && conda activate base
- 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
- conda install -c conda-forge numpy
- conda env create -f ci/environment_py${PYTHON_VERSION}.yml
- conda activate test
- if [[ "$PYTHON_VERSION" == "2.7" ]]; then
pip install pathlib;
fi
- pip install . coveralls pytest
# install necessary module for the documentation and clone the existing
# gh-pages for this repo into the *deploy* folder and clear everything
- export REPO="$(git config remote.origin.url)"
- if [[ "$BUILD_DOCS" == "true" ]]; then
pip install sphinx-fortran sphinx==1.3.5 sphinx_rtd_theme ipython sphinx-argparse==0.1.17 autodocsumm;
git clone "$REPO" deploy;
cd deploy;
git checkout "gh-pages" || git checkout --orphan "gh-pages";
ls -ad * .* | grep -v ".git$" | grep -v "^\.$" | grep -v "^\.\.$" | xargs rm -r;
touch .nojekyll;
cd ..;
fi
# export the environment for debugging
- conda env export -n test
script:
- gwgen -h
# run test suite
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
coverage run --parallel-mode --concurrency=multiprocessing setup.py test -a "-v --serial -m 'not fullrun and not long' -k 'not test_parameterization' --user postgres --offline";
elif [[ "$ONLINE_TESTS" == "true" ]]; then
coverage run --parallel-mode --concurrency=multiprocessing setup.py test -a "-v --nprocs 2 -m 'not fullrun' --user postgres";
else
coverage run --parallel-mode --concurrency=multiprocessing setup.py test -a "-v --nprocs 2 -m 'not fullrun' --user postgres --offline";
fi
# build docs
- if [[ "$BUILD_DOCS" == "true" ]]; then
cd docs;
sphinx-build . ../deploy;
cd ..;
fi
after_success:
- coverage combine && coveralls
deploy:
- provider: script
script: ci/deploy.sh
skip_cleanup: true
on:
branch: master
condition: "$BUILD_DOCS == true"