Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/before_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
if [[ $TEST_CONDA == 0 && $RUNNER_OS != "Linux" ]]; then
echo "Only Linux supported for non-Conda builds";
exit 1;
fi
# from here on assume $TEST_CONDA == 0 implies $TRAVIS_OS_NAME == linux

if [[ $TEST_CONDA == 0 ]]; then
sudo apt-get install liblapack-dev libblas-dev;
sudo apt-get install gfortran;
sudo apt-get install cmake;
fi
47 changes: 47 additions & 0 deletions .github/workflows/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
. ./.github/workflows/set_os_env.sh

#
# Install miniconda to allow quicker installation of dependencies
# See https://conda.io/docs/user-guide/tasks/use-conda-with-travis-ci.html
#

if [[ $RUNNER_OS == "macOS" ]]; then
. ./.github/workflows/wget_install_miniconda.sh
fi

hash -r
conda config --set always_yes yes --set changeps1 no
conda update -q --all
if [[ $TEST_CONDA == 1 ]]; then
conda install conda-build;
conda install conda-verify;
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


# 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
29 changes: 29 additions & 0 deletions .github/workflows/run_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Local unit tests
# TODO: replace with nose?

echo "start xvfb ====================================="
Xvfb :99 &
export DISPLAY=:99

. ./.github/workflows/set_os_env.sh

echo "source activate test-environment ==============="
source activate test-environment
echo "change directory to .. ========================="
cd ..
echo "python Slycot/runtests.py ======================"
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

echo "conda install scipy matplotlib ================="
conda install scipy matplotlib
# Get python-control from source and install
echo "git clone python-control ======================="
git clone --depth 1 https://github.com/python-control/python-control.git control
cd control
echo "python python-control/setup.py test ==========="
python setup.py test
31 changes: 31 additions & 0 deletions .github/workflows/set_os_env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
echo "exporting env vars ============================="

if [[ $RUNNER_OS == "Linux" ]]; then
export MINICONDA_PATH=$CONDA
export CONDA_SCRIPT=bin # l o
export BASHRC=.bashrc # l
elif [[ $RUNNER_OS == "macOS" ]]; then
export MINICONDA_PATH=$RUNNER_WORKSPACE/miniconda
export CONDA_SCRIPT=bin # l o
export BASHRC=.bash_profile # o w
elif [[ $RUNNER_OS == "Windows" ]]; then
export MINICONDA_PATH=`cygpath --unix $CONDA`
export CONDA_SCRIPT=Scripts # w
export BASHRC=.bash_profile # o w
fi

export MINICONDA_SUB_PATH=$MINICONDA_PATH/$CONDA_SCRIPT
export MINICONDA_PYTEST=$MINICONDA_PATH/envs/test-environment/$CONDA_SCRIPT/py.test
#
# Make sure that fortran compiler can find conda libraries
#
export LIBRARY_PATH="$MINICONDA_PATH/envs/test-environment/lib";
export PATH="$MINICONDA_PATH:$MINICONDA_SUB_PATH:$PATH"

echo "MINICONDA_PATH=$MINICONDA_PATH"
echo "CONDA_SCRIPT=$CONDA_SCRIPT"
echo "BASHRC=$BASHRC"
echo "MINICONDA_SUB_PATH=$MINICONDA_SUB_PATH"
echo "MINICONDA_PYTEST=$MINICONDA_PYTEST"
echo "LIBRARY_PATH=$LIBRARY_PATH"
echo "PATH=$PATH"
32 changes: 32 additions & 0 deletions .github/workflows/test_linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: CI linux

on : [push]

jobs:
build:
name: Python ${{ matrix.python }} with TEST_CONDA=${{ matrix.test_conda }}
runs-on: ubuntu-16.04
strategy:
matrix:
python: [2.7, 3.5, 3.6, 3.7]
test_conda: [0, 1]
steps:
- uses: actions/checkout@v1
- name: before install
env:
TEST_CONDA: ${{ matrix.test_conda }}
run:
source ./.github/workflows/before_install.sh
- name: install
env:
SLYCOT_PYTHON_VERSION: ${{ matrix.os }}
TEST_CONDA: ${{ matrix.test_conda }}
run:
source ./.github/workflows/install.sh
- name: run tests
run:
source ./.github/workflows/run_tests.sh
- name: coverall
run:
pip install coveralls
coveralls
31 changes: 31 additions & 0 deletions .github/workflows/test_osx.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: CI osx

on : [push]

jobs:
build:
name: Python ${{ matrix.python }} with TEST_CONDA=1
runs-on: macOS-10.14
strategy:
matrix:
python: [2.7, 3.5, 3.6, 3.7]
steps:
- uses: actions/checkout@v1
- name: before install
env:
TEST_CONDA: 1
run:
source ./.github/workflows/before_install.sh
- name: install
env:
SLYCOT_PYTHON_VERSION: ${{ matrix.os }}
TEST_CONDA: 1
run:
source ./.github/workflows/install.sh
- name: run tests
run:
source ./.github/workflows/run_tests.sh
- name: coverall
run:
pip install coveralls
coveralls
17 changes: 17 additions & 0 deletions .github/workflows/wget_install_miniconda.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
echo "============================================"
echo "Downloading and Installing Miniconda for"
echo "============================================"

export MINICONDA_DOWNLOAD=$MINICONDA_PATH/download
echo "MINICONDA_DOWNLOAD = $MINICONDA_DOWNLOAD"

mkdir -p $MINICONDA_DOWNLOAD;
echo "downloading miniconda.sh for osx ==========="
wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O $MINICONDA_DOWNLOAD/miniconda.sh;

echo "installing miniconda ======================="
bash $MINICONDA_DOWNLOAD/miniconda.sh -b -u -p $MINICONDA_PATH;

echo "============================================"
echo "Finished Installing Miniconda"
echo "============================================"