Handle input containing division by zero better #134
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ODE-toolbox build | |
on: [push, pull_request] | |
jobs: | |
static_checks: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout ODE-toolbox code | |
uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.9 | |
- 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@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.9 | |
- name: Install apt dependencies | |
run: | | |
sudo apt update | |
sudo apt install pkg-config python3-all-dev | |
- name: Install GSL | |
if: ${{ matrix.with_gsl == '1' }} | |
run: | | |
sudo apt remove libgsl27 libgsl-dev # remove system-wide GSL version that is installed by default | |
cd .. | |
wget https://mirror.ibcp.fr/pub/gnu/gsl/gsl-2.7.tar.gz # this should be "gsl-latest.tar.gz", but there is an issue with GSL 2.8 (see https://github.com/pygsl/pygsl/issues/62) | |
tar -xzf gsl-2.7.tar.gz | |
cd gsl-2.7 | |
./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 # this should be "pip install pygsl", but see https://github.com/pygsl/pygsl/issues/59 | |
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 |