forked from python-control/Slycot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
106 lines (97 loc) · 3.62 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
# Travis configuration file for slycot
matrix:
include:
- name: "Python 2.7, TEST_CONDA=0"
env: SLYCOT_PYTHON_VERSION=2.7 TEST_CONDA=0
- name: "Python 2.7, TEST_CONDA=1"
env: SLYCOT_PYTHON_VERSION=2.7 TEST_CONDA=1
- name: "Python 3.5, TEST_CONDA=0"
env: SLYCOT_PYTHON_VERSION=3.5 TEST_CONDA=0
- name: "Python 3.5, TEST_CONDA=1"
env: SLYCOT_PYTHON_VERSION=3.5 TEST_CONDA=1
- name: "Python 3.6, TEST_CONDA=0"
env: SLYCOT_PYTHON_VERSION=3.6 TEST_CONDA=0
- name: "Python 3.6, TEST_CONDA=1"
env: SLYCOT_PYTHON_VERSION=3.6 TEST_CONDA=1
- name: "Python 3.7, TEST_CONDA=0"
env: SLYCOT_PYTHON_VERSION=3.7 TEST_CONDA=0
- name: "Python 3.7, TEST_CONDA=1"
env: SLYCOT_PYTHON_VERSION=3.7 TEST_CONDA=1
before_install:
#
# Install fortran compiler, if not using Conda's
# If not using conda, then install liblapack here (conda version
# will handle this through the build recipe)
#
- if [[ $TEST_CONDA == 0 ]]; then
sudo apt-get install liblapack-dev libblas-dev;
sudo apt-get install gfortran;
sudo apt-get install cmake;
fi
install:
#
# Install miniconda to allow quicker installation of dependencies
# See https://conda.io/docs/user-guide/tasks/use-conda-with-travis-ci.html
#
- if [[ "$SLYCOT_PYTHON_VERSION" == "2.7" ]]; then
wget http://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh;
else
wget http://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 --all
- if [[ $TEST_CONDA == 1 ]]; then conda install conda-build; fi
- conda info -a
#
# Set up a test environment for testing everything out
- conda create -q -n test-environment python="$SLYCOT_PYTHON_VERSION" pip coverage nose numpy openblas
- source activate test-environment
#
# Make sure that fortran compiler can find conda libraries
#
- export LIBRARY_PATH="$HOME/miniconda/envs/test-environment/lib";
# install scikit-build
- if [[ $TEST_CONDA == 0 ]]; then
conda config --append channels conda-forge;
conda install -c conda-forge scikit-build >=0.8.0 ;
fi
#
# Install the slycot package (two ways, to improve robustness). For the
# conda version, need to install lapack from conda-forge (no way to specify
# this in the recipe).
# add the conda-forge channel to the config, otherwise openblas or
# lapack cannot be found in the check
# with --override-channels to make sure the locally built slycot is installed
#
- if [[ $TEST_CONDA == 1 ]]; then
conda config --append channels conda-forge;
conda build --python "$SLYCOT_PYTHON_VERSION" conda-recipe-openblas;
conda install conda-forge::openblas>=0.3.0;
conda install local::slycot;
else
CMAKE_GENERATOR="Unix Makefiles" python setup.py install;
fi
#
# coveralls not in conda repos :-(
- pip install coveralls
script:
# Local unit tests
# TODO: replace with nose?
- cd ..
- python Slycot/runtests.py --coverage --no-build
#
# As a deeper set of tests, get test against python-control as well
#
# Additional packages required for python-control
- conda install scipy matplotlib
# Install display manager to allow testing of plotting functions
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
# Get python-control from source and install
- git clone https://github.com/python-control/python-control.git control
- cd control; python setup.py test
after_success:
- coveralls