forked from brian-team/brian2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
138 lines (130 loc) · 6.17 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
language: c # We are not using the Python infrastructure
sudo: false # Make sure we are using the container-based infrastructure
# Install packages for cross-compilation to 32 Bit
addons:
apt:
packages:
- gcc-multilib
- g++-multilib
- lib32z1
artifacts:
paths:
- $(ls dist/*.whl | tr "\n" ":")
s3_region: "us-east-1"
env:
global:
- ARTIFACTS_BUCKET=brian2-travis-artifacts
- secure: "cQocTghprWx5J+Y42AcLfzl4mPyDdsE1wlqAJ71u+wzJu9AVxPC3ARblAn/T9Tjyma5UFZf2WIIxKnjRNg3DfYFeJWWCRMk9p/ji5guM+1rD/xE/XQdR061EsRAundnOJns9/BQeKQ5r4Gex2vky+X0PU9Nds53nrroA33HiHA0="
- secure: "S+Ga7Wd4IeVYEm/yi8YBW6c6RxTLSlmj/UcjfoMLQTadDBIjjpuOtCLTlgJceyxlfbXOyKRI+D3sjFWzVWCzYVrui/lnpIBNEgMiaNOXjYkmdktOEfjPEVAgR0OZsNr25h0hr3ITWSLoS4XYNfxclDG6YMzVOuYlV+1TAfQJJ04="
matrix:
include:
# test that the documentation can be built from the tarball -- we
# automatically build it from github master all the time, but downstream
# packaging will use the tarball as the basis
- python: "3.7"
env: PYTHON="3.7" DOCS_ONLY=yes ARCHITECTURE="x86_64"
os: linux
# Standard tests
- python: "3.7"
env: PYTHON="3.7" STANDALONE=no CYTHON=yes MINIMAL_VERSIONS=no REPORT_COVERAGE=yes CONDA_PY="37" DO_CONDA_BUILD='yes' SPLIT_RUN=1 ARCHITECTURE="x86_64"
os: linux
- python: "3.7"
env: PYTHON="3.7" STANDALONE=no CYTHON=yes MINIMAL_VERSIONS=no REPORT_COVERAGE=yes CONDA_PY="37" DO_CONDA_BUILD='no' SPLIT_RUN=2 ARCHITECTURE="x86_64"
os: linux
- python: "3.7"
env: PYTHON="3.7" STANDALONE=no CYTHON=yes MINIMAL_VERSIONS=no REPORT_COVERAGE=no CONDA_PY="37" DO_CONDA_BUILD='yes' SPLIT_RUN=1 ARCHITECTURE="x86_64"
os: osx
- python: "3.7"
env: PYTHON="3.7" STANDALONE=no CYTHON=yes MINIMAL_VERSIONS=no REPORT_COVERAGE=no CONDA_PY="37" DO_CONDA_BUILD='no' SPLIT_RUN=2 ARCHITECTURE="x86_64"
os: osx
- python: "3.7"
env: PYTHON="3.7" STANDALONE=no CYTHON=yes MINIMAL_VERSIONS=no REPORT_COVERAGE=no CONDA_PY="37" DO_CONDA_BUILD='yes' SPLIT_RUN=1 ARCHITECTURE="x86_64" FLOAT_DTYPE_32=yes
os: osx
- python: "3.7"
env: PYTHON="3.7" STANDALONE=no CYTHON=yes MINIMAL_VERSIONS=no REPORT_COVERAGE=no CONDA_PY="37" DO_CONDA_BUILD='no' SPLIT_RUN=2 ARCHITECTURE="x86_64" FLOAT_DTYPE_32=yes
os: osx
# test standalone
- python: "3.7"
env: PYTHON="3.7" STANDALONE=yes CYTHON=yes MINIMAL_VERSIONS=no REPORT_COVERAGE=yes DO_CONDA_BUILD='no' ARCHITECTURE="x86_64"
os: linux
- python: "3.7"
env: PYTHON="3.7" STANDALONE=yes CYTHON=yes MINIMAL_VERSIONS=no REPORT_COVERAGE=yes DO_CONDA_BUILD='no' ARCHITECTURE="x86_64" FLOAT_DTYPE_32=yes
os: linux
# Use miniconda to install binary versions of numpy etc. from continuum
# analytic's repository. Follows an approach described by Dan Blanchard:
# https://gist.github.com/dan-blanchard/7045057
before_install:
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
travis_retry wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-$ARCHITECTURE.sh -O miniconda.sh;
else
travis_retry wget http://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-$ARCHITECTURE.sh -O miniconda.sh;
fi
- chmod +x miniconda.sh
# When we are installing the 32 Bit conda on a 64 Bit system, the miniconda
# installer will ask for a "yes" despite the -b flag, so we pipe in a yes
- yes | ./miniconda.sh -b -p ~/miniconda
- source ~/miniconda/etc/profile.d/conda.sh
# command to install dependencies
install:
- travis_retry conda update --yes conda
# Use the conda-forge channel
- conda config --append channels conda-forge
# For faster tests, only build conda packages for the master branch or pull requests
- if [[ $TRAVIS_PULL_REQUEST == 'false' ]] && [[ $TRAVIS_BRANCH != 'master' ]]; then
DO_CONDA_BUILD='no';
fi
- if [[ $DO_CONDA_BUILD == 'yes' ]]; then
conda install --yes --quiet anaconda-client conda-build jinja2;
fi
- if [[ $MINIMAL_VERSIONS == 'yes' ]]; then
PYTHON_PACKAGES="python=$PYTHON numpy==1.10 scipy==0.16 libgfortran==1 pytest pytest-xdist sphinx==1.8 ipython sympy==1.2 jinja2==2.7 pyparsing setuptools coverage<5 gsl>1.15 cython";
else
PYTHON_PACKAGES="python=$PYTHON numpy pytest pytest-xdist sphinx>=1.8 ipython sympy>=1.2 pyparsing jinja2 setuptools coverage<5 gsl>1.15 cython";
fi
- PYTHON_PACKAGES="$PYTHON_PACKAGES scipy";
- if [[ $REPORT_COVERAGE == 'yes' ]]; then PYTHON_PACKAGES="$PYTHON_PACKAGES pytest-cov coveralls"; fi
# Install packages into a new environment
- travis_retry conda create --quiet --yes -n travis_conda $PYTHON_PACKAGES
- conda activate travis_conda
- python setup.py install --fail-on-error --single-version-externally-managed --record=record.txt
- if [[ $DOCS_ONLY == 'yes' ]]; then
python setup.py sdist;
fi;
# command to run tests (make sure to not run it from the source directory)
script:
- export MACOSX_DEPLOYMENT_TARGET=10.9 # Prevents build errors linked when using isinf
- if [[ $DO_CONDA_BUILD == 'yes' ]]; then
conda deactivate;
conda build --quiet -c conda-forge dev/conda-recipe;
conda activate travis_conda;
fi
- if [[ $DOCS_ONLY == 'yes' ]]; then
cd dist;
tar xvzf *.tar.gz;
cd Brian2*;
mkdir docs;
sphinx-build docs_sphinx docs;
else
export SRCDIR=$(pwd);
SCRIPTFILE=$SRCDIR/dev/continuous-integration/run_test_suite.py;
cd ~;
if [[ $ARCHITECTURE == 'x86' ]]; then mkdir ~/.brian; cp $SRCDIR/dev/continuous-integration/preferences_for_32_bit ~/.brian/user_preferences; export CROSS_COMPILED=TRUE; fi;
coverage run --rcfile=$SRCDIR/.coveragerc $SCRIPTFILE;
fi
after_success:
- if [[ $REPORT_COVERAGE == 'yes' ]]; then
cd ~;
cp .coverage $SRCDIR;
cd $SRCDIR;
COVERALLS_PARALLEL=true coveralls --rcfile=$SRCDIR/.coveragerc;
fi
# Create binary packages for pypi and upload them to AWS
- if [[ $DO_CONDA_BUILD == 'yes' && $TRAVIS_PULL_REQUEST == 'false' && $TRAVIS_REPO_SLUG == 'brian-team/brian2' && $TRAVIS_BRANCH == 'master' ]]; then
conda install --yes --quiet wheel;
cd $SRCDIR;
python setup.py bdist_wheel --with-cython --fail-on-error;
fi
notifications:
email: false
# Tell coveralls that the coverage results should be merged now
webhooks: https://coveralls.io/webhook