forked from usnistgov/fipy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
90 lines (90 loc) · 3.38 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
# inspired by http://conda.pydata.org/docs/travis.html
#
# language: python causes grief on osx
language: generic
os:
# - osx
- linux
env:
- TRAVIS_PYTHON_VERSION=2.7 MPIRUN= FIPY_SOLVERS=pysparse
- TRAVIS_PYTHON_VERSION=2.7 MPIRUN= FIPY_SOLVERS=pysparse FIPY_INLINE=1
- TRAVIS_PYTHON_VERSION=2.7 MPIRUN= FIPY_SOLVERS=scipy
- TRAVIS_PYTHON_VERSION=2.7 MPIRUN= FIPY_SOLVERS=trilinos
- TRAVIS_PYTHON_VERSION=2.7 MPIRUN="mpirun -np 2" FIPY_SOLVERS=trilinos
- TRAVIS_PYTHON_VERSION=3.6 MPIRUN= FIPY_SOLVERS=scipy
cache: apt
addons:
apt:
packages:
# - liblapack3
# - liblapack.so.3
# - libatlas-dev
# - libatlas-base-dev
# - liblapack-dev
# - liblapack3gf
# - gfortran
branches:
except:
- nist-pages
before_install:
# sudo ln -s /usr/lib/lapack/liblapack.so.3gf /usr/lib/lapack/liblapack.so.3;
# sudo ldconfig;
- if [[ $TRAVIS_OS_NAME -eq "linux" ]]; then
sudo apt-get update;
fi
# We do this conditionally because it saves us some downloading if the
# version is the same.
- PY3K=$(echo "$TRAVIS_PYTHON_VERSION >= 3.0" | bc)
- if [[ $TRAVIS_OS_NAME -eq "linux" ]]; then
export MINICONDA_OS_NAME=Linux;
elif [[ $TRAVIS_OS_NAME -eq "osx" ]]; then
export MINICONDA_OS_NAME=MacOSX;
fi
- if [[ $PY3K -eq 1 ]]; then
export MINICONDA_VERSION=3;
else
export MINICONDA_VERSION=;
fi
- wget https://repo.continuum.io/miniconda/Miniconda${MINICONDA_VERSION}-latest-${MINICONDA_OS_NAME}-x86_64.sh -O miniconda.sh;
- 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
# fipy conda package does not properly load scipy and numpy from
# conda-forge channel when on linux
- if [[ $TRAVIS_OS_NAME -eq "linux" ]]; then
if [[ $PY3K -eq 1 ]]; then
conda create --quiet --name test-environment --show-channel-urls --channel guyer --channel conda-forge python=$TRAVIS_PYTHON_VERSION numpy scipy gmsh matplotlib;
else
conda create --quiet --name test-environment --show-channel-urls --channel guyer --channel conda-forge python=$TRAVIS_PYTHON_VERSION numpy scipy gmsh pysparse mpi4py matplotlib mayavi fipytrilinos weave;
fi
elif [[ $TRAVIS_OS_NAME -eq "osx" ]]; then
conda create --quiet --name test-environment --show-channel-urls --channel guyer --channel conda-forge python=$TRAVIS_PYTHON_VERSION fipy weave;
fi
- source activate test-environment
# Useful for debugging any issues with conda
- conda info -a
- pip install scikit-fmm
install:
- if [[ $PY3K -eq 1 ]]; then
2to3 --write . &> /dev/null;
2to3 --write --doctests_only . &> /dev/null;
fi
- python setup.py install
before_script:
# lack of display causes tests to abort at VtkViewer
# Workaround @ http://docs.enthought.com/mayavi/mayavi/tips.html#rendering-using-the-virtual-framebuffer
# and https://docs.travis-ci.com/user/gui-and-headless-browsers/#Using-xvfb-to-Run-Tests-That-Require-a-GUI
- if [[ $TRAVIS_OS_NAME -eq "linux" ]]; then
export DISPLAY=:99.0;
sh -e /etc/init.d/xvfb start;
sleep 3;
fi
script:
# inline must be run twice to clear out compiler warnings
# we don't care if it fails the first time
- if [[ ! -z "${FIPY_INLINE}" ]]; then
$MPIRUN python setup.py test > /dev/null 2>&1 || true;
fi
- $MPIRUN python setup.py test;