Skip to content

Commit

Permalink
Compile IDAKLU from source for unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
agriyakhetarpal committed Feb 26, 2024
1 parent d63fc76 commit 91644c5
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
31 changes: 26 additions & 5 deletions .github/workflows/test_on_push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,40 @@ jobs:
python-version: "3.12"

steps:
- uses: actions/checkout@v4
- name: Check out PyBOP repository
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip nox
- name: Check out PyBaMM v24.1
uses: actions/checkout@v4
with:
repository: pybamm-team/PyBaMM
ref: v24.1
path: pybamm

- name: Compile PyBaMM from source with IDAKLU solver
run: |
cd pybamm
sudo apt-get update
sudo apt-get install -y libopenblas-dev
python -m nox -s pybamm-requires
python -m pip install .[all]
rm -rf pybind11/
cd ..
- name: Unit and notebook tests with nox
run: |
nox -s unit
nox -s notebooks
pip install -e .[all,dev]
python -m pytest --unit
python -m pytest --nbmake --examples examples/
# Runs only on Ubuntu with Python 3.11
check_coverage:
Expand Down Expand Up @@ -104,8 +126,7 @@ jobs:
- name: Run coverage tests for Ubuntu with Python 3.11 and generate report
run: |
pip install -e .[all]
pip install pytest pytest-cov pytest-mock
pip install -e .[all,dev]
python -m pytest --unit --examples --cov --cov-report=xml
- name: Upload coverage report
Expand Down
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def notebooks(session):
session.install("-e", ".[all,dev]", silent=False)
if PYBOP_SCHEDULED:
session.run("pip", "install", f"pybamm=={PYBAMM_VERSION}", silent=False)
session.run("pytest", "--nbmake", "--examples", "examples/", external=True)
session.run("pytest", "--nbmake", "--examples", "examples/")


@nox.session
Expand Down

0 comments on commit 91644c5

Please sign in to comment.