Repository navigation
Expand file tree
/
Copy path.travis.yml
More file actions
144 lines (137 loc) · 5.12 KB
/
Copy path.travis.yml
File metadata and controls
144 lines (137 loc) · 5.12 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
# 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.9"
- "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" # force 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: "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
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 install conda-build
conda install conda-verify
conda config --add channels conda-forge;
conda update -q --all
conda info -a;
conda create -q -n test-environment \
python="$SLYCOT_PYTHON_VERSION" \
pip coverage pytest-cov \
numpy scipy matplotlib
conda activate test-environment
export LIBRARY_PATH="$HOME/miniconda/envs/test-environment/lib"
numpyversion=$(python -c 'import numpy; print(numpy.version.version)')
conda build --python "$SLYCOT_PYTHON_VERSION" --numpy $numpyversion conda-recipe
conda install local::slycot
if [[ $BLA_VENDOR == "OpenBLAS" ]]; then
conda install 'libblas=*=*openblas'
elif [[ $BLA_VENDOR == "Intel10_64lp" ]]; then
conda install 'libblas=*=*mkl'
elif [[ $BLA_VENDOR == "Apple" ]]; then
export LD_LIBRARY_PATH="/opt/MacOSX10.9.sdk/usr/lib"
else
echo "Unsupported BLA_VENDOR for conda builds: $BLA_VENDOR"
exit 3
fi
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
script:
# slycots own unit tests as installed, not those from source dir
- mkdir ../slycot-coverage
- cd ../slycot-coverage
- 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, use the suite from python-control master branch as well
- cd ..
- git clone --depth 1 https://github.com/python-control/python-control.git
- cd python-control
- pytest --disable-warnings --cov=$slycot_dir --cov-config=../Slycot/.coveragerc control/tests
after_success:
# go back to Slycot dir and merge the coverage for a total tally
- cd ../Slycot
- cp ../slycot-coverage/.coverage .coverage.slycot
- cp ../python-control/.coverage .coverage.control
- echo " $slycot_dir" >> .coveragerc
- coverage combine
- coverage report
# reporting to coveralls only happens from the github actions runs