Skip to content

Update GSL on GitHub Actions CI #168

Update GSL on GitHub Actions CI

Update GSL on GitHub Actions CI #168

name: ODE-toolbox build
on: [push, pull_request]
jobs:
static_checks:
runs-on: ubuntu-latest
steps:
- name: Checkout ODE-toolbox code
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install apt dependencies
run: |
sudo apt update
sudo apt install pkg-config python3-all-dev
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip pytest pycodestyle codecov pytest-cov wheel
python -m pip install -r requirements.txt
export PYTHON_VERSION=`python -c "import sys; print('.'.join(map(str, [sys.version_info.major, sys.version_info.minor])))"`
echo "Python version detected:"
echo $PYTHON_VERSION
- name: Install ODE-toolbox
run: |
echo PYTHONPATH=`pwd` >> $GITHUB_ENV
python setup.py install
- name: Static code style analysis
run: |
python3 -m pycodestyle $GITHUB_WORKSPACE -v --ignore=E241,E501,E303,E714,E713,E714,E252 --exclude=$GITHUB_WORKSPACE/doc,$GITHUB_WORKSPACE/.eggs,$GITHUB_WORKSPACE/build,$GITHUB_WORKSPACE/.git,$GITHUB_WORKSPACE/odetoolbox.egg-info,$GITHUB_WORKSPACE/dist
build:
needs: [static_checks]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
with_gsl: ["0", "1"]
sympy_version: ["==1.4", "!=1.5,!=1.5.*,!=1.6rc1,!=1.6rc2,!=1.6,!=1.6.*,!=1.10,!=1.10.*,!=1.13,!=1.13.*"]
steps:
- name: Checkout ODE-toolbox code
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install apt dependencies
run: |
sudo apt update
sudo apt install pkg-config python3-all-dev
- name: Install GSL
run: |
cd ..
wget https://mirror.ibcp.fr/pub/gnu/gsl/gsl-latest.tar.gz
tar -xzf gsl-latest.tar.gz
cd gsl-2.*
./configure && make && sudo make install
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip pytest pycodestyle codecov pytest-cov wheel
python -m pip install numpy
if [ "${{ matrix.with_gsl }}" == "1" ]; then python3 -m pip install -v https://github.com/pygsl/pygsl/archive/refs/tags/v2.4.1.tar.gz ; fi
python -m pip install -r requirements.txt
export PYTHON_VERSION=`python -c "import sys; print('.'.join(map(str, [sys.version_info.major, sys.version_info.minor])))"`
echo "Python version detected:"
echo $PYTHON_VERSION
pip uninstall --yes sympy
pip install sympy${{ matrix.sympy_version }}
echo "Using sympy version:"
python -c "import sympy; print(sympy.__version__)"
- name: Install ODE-toolbox
run: |
echo PYTHONPATH=`pwd` >> $GITHUB_ENV
python setup.py install
- name: Run unit tests
run: |
echo "[run]" > .coveragerc
echo "omit = tests/*" >> .coveragerc
echo >> .coveragerc
python -m pytest -s -o log_cli=true -o log_cli_level="DEBUG" --cov=. --cov-config=.coveragerc tests
- name: Run codecov
run: |
codecov