forked from nest/ode-toolbox
-
Notifications
You must be signed in to change notification settings - Fork 1
101 lines (84 loc) · 3.62 KB
/
ode-toolbox-build.yml
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
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