-
Notifications
You must be signed in to change notification settings - Fork 1
86 lines (83 loc) · 2.43 KB
/
ci.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
name: CI
on:
push:
branches:
- main
pull_request:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: pip
- name: Run pre-commit
uses: pre-commit/[email protected]
tests:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
# - windows-latest Reason: get it running on ubuntu-latest first
# - macOS-latest Reason: get it running on ubuntu-latest first
python-version: ["3.10",]
name: Run tests
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.8.3
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Verify poetry installation
run: poetry --version
- name: Install amici dependencies
run: |
sudo apt update
sudo apt install -y swig
sudo apt install -y libblas-dev
sudo apt install -y libatlas-base-dev
sudo apt install -y libhdf5-dev
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
run: poetry install --no-interaction --with=dev --extras=sbml
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
- name: Prepare cpp test
run: |
sudo apt install -y cmake
sudo apt install -y libeigen3-dev
sudo ln -s /usr/include/eigen3/Eigen /usr/include/Eigen
sudo apt install -y pybind11-dev
source $VENV
cd eulerpi/examples/cpp
mkdir build
cd build
cmake ..
make -j
- name: Run pytest
run: |
source $VENV
pytest -v
# TODO: coverage run creates segmentation fault on Github ci, but not locally. Debug it
# - name: Run coverage
# run: |
# source $VENV
# coverage run -m pytest -v
# coverage report