-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy path.travis.yml
More file actions
153 lines (146 loc) · 5.19 KB
/
.travis.yml
File metadata and controls
153 lines (146 loc) · 5.19 KB
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# Default entries for matrix jobs
os: linux
language: python
dist: bionic
services: xvfb # needed for the python-control tests
# Start with a 2x4 matrix of Linux builds
python:
- "3.8"
- "3.7"
env:
- TEST_PKG="conda" BLA_VENDOR="OpenBLAS"
- TEST_PKG="conda" BLA_VENDOR="Intel10_64lp" # MKL
- TEST_PKG="dist" BLA_VENDOR="OpenBLAS"
- TEST_PKG="dist" BLA_VENDOR="Generic" # reference BLAS/LAPACK
jobs:
# additional single Linux and OSX jobs
include:
- name: "Linux, Conda Python 3.6"
python: "3.6"
env: TEST_PKG="conda" BLA_VENDOR="OpenBLAS"
- name: "Linux, Conda Python 3.5"
python: "3.5"
env: TEST_PKG="conda" BLA_VENDOR="OpenBLAS"
- name: "Linux, Ubuntu 16.04, System Python 2.7"
python: "2.7"
dist: xenial
env: TEST_PKG="dist" BLA_VENDOR="OpenBLAS"
# (Conda Python 2 is broken due to pytest-cov dependencies)
- name: "MacOSX, Conda Python 3"
os: osx
language: shell
env: TEST_PKG="conda" BLA_VENDOR="Apple"
- name: "MacOSX, System Python 3"
os: osx
language: shell
env: TEST_PKG="dist" BLA_VENDOR="Apple"
- name: "MacOSX, pyenv 3.8.0"
os: osx
language: shell
env: TEST_PKG="dist" BLA_VENDOR="Apple" SLYCOT_PYTHON_VERSION=3.8.0
- name: "MacOSX, pyenv 2.7.17"
os: osx
language: shell
env: TEST_PKG="dist" BLA_VENDOR="Apple" SLYCOT_PYTHON_VERSION=2.7.17
before_install:
- |
# Install Ubuntu packages
if [[ $TEST_PKG == "dist" && $TRAVIS_OS_NAME == linux ]]; then
sudo apt-get update
sudo apt-get -y install gfortran cmake
if [[ $BLA_VENDOR == "OpenBLAS" ]]; then
sudo apt-get -y install libopenblas-dev
elif [[ $BLA_VENDOR == "Generic" ]]; then
sudo apt-get -y install libblas-dev liblapack-dev
else
echo "Unsupported BLAS Vendor: '$BLA_VENDOR'"
exit 2
fi
fi
- |
# Install MacOSX packages
if [[ $TEST_PKG == "dist" && $TRAVIS_OS_NAME == osx ]]; then
if [ -n "$SLYCOT_PYTHON_VERSION" ]; then
pyenv install $SLYCOT_PYTHON_VERSION
pyenv global $SLYCOT_PYTHON_VERSION
eval "$(pyenv init -)"
export MPLBACKEND="TkAgg"
else
mkdir -p ~/.local/bin
ln -s $(which python3) ~/.local/bin/python
ln -s $(which pip3) ~/.local/bin/pip
fi
fi
install:
- |
# compile using conda environment or distribution libraries
echo "Python Version: ${SLYCOT_PYTHON_VERSION:=${TRAVIS_PYTHON_VERSION:-3.8}}"
if [[ $TEST_PKG == conda ]]; then
#
# Install miniconda to allow quicker installation of dependencies
# See https://conda.io/projects/conda/en/latest/user-guide/tasks/use-conda-with-travis-ci.html
#
if [[ $TRAVIS_OS_NAME == linux ]]; then
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
elif [[ $TRAVIS_OS_NAME == osx ]]; then
wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh
wget https://github.com/phracker/MacOSX-SDKs/releases/download/10.15/MacOSX10.9.sdk.tar.xz
sudo tar -C /opt -xJf MacOSX10.9.sdk.tar.xz
else
echo "Unsupported OS for conda builds: $TRAVIS_OS_NAME"
exit 4
fi
bash miniconda.sh -b -p $HOME/miniconda
source "$HOME/miniconda/etc/profile.d/conda.sh"
hash -r
conda config --set always_yes yes --set changeps1 no
conda update -q --all
conda install conda-build
conda install conda-verify
conda config --append channels conda-forge;
conda info -a;
if [[ $BLA_VENDOR == "OpenBLAS" ]]; then
conda_blas=openblas
conda_recipe=conda-recipe-openblas
elif [[ $BLA_VENDOR == "Intel10_64lp" ]]; then
conda_blas=mkl
conda_recipe=conda-recipe-mkl
elif [[ $BLA_VENDOR == "Apple" ]]; then
conda_blas=
conda_recipe=conda-recipe-apple
else
echo "Unsupported BLA_VENDOR for conda builds: $BLA_VENDOR"
exit 3
fi
conda create -q -n test-environment \
python="$SLYCOT_PYTHON_VERSION" \
pip coverage pytest-cov \
numpy scipy matplotlib \
$conda_blas
conda activate test-environment
export LIBRARY_PATH="$HOME/miniconda/envs/test-environment/lib"
conda build --python "$SLYCOT_PYTHON_VERSION" $conda_recipe
conda install local::slycot
elif [[ $TEST_PKG == dist ]]; then
pip install scikit-build pytest-cov matplotlib scipy;
CMAKE_GENERATOR="Unix Makefiles" python setup.py install;
else
echo "Wrong TEST_PKG '$TEST_PKG'"
exit 1
fi
# coveralls not in ubuntu or conda repos
pip install coveralls
script:
# slycots own unit tests as installed, not those from source dir
- cd ..
- slycot_dir=$(python -c "import slycot; print(slycot.__path__[0])")
- pytest --pyargs slycot --cov=$slycot_dir --cov-config=Slycot/.coveragerc
#
# As a deeper set of tests, get test against python-control as well
#
# Get python-control from source and install
- git clone --depth 1 https://github.com/python-control/python-control.git control
- cd control
- python setup.py test
after_success:
- coveralls