Skip to content

Commit

Permalink
Add and debug PyBaMM test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
agriyakhetarpal committed Mar 25, 2024
1 parent 314825c commit 11dfa57
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/test_suite.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: PyBaMM wheel tests

on:
workflow_dispatch:
pull_request:

env:
FORCE_COLOR: 3

jobs:
run_unit_tests:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.11.8"]
name: test-suite-${{ matrix.os }}-pybamm-24.1-${{ matrix.python-version }}

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

- name: Install PyBaMM via wheels
run: python -m pip install "pybamm[all,dev]==24.1"

- name: Checkout tests from PyBaMM repository
uses: actions/checkout@v4
with:
repository: pybamm-team/PyBaMM
ref: 'v24.1'
sparse-checkout: |
tests
sparse-checkout-cone-mode: true

- name: Find PyBaMM installation
shell: python
run: |
import os
import pybamm
from pathlib import Path
pybamm_path = Path(pybamm.__file__).parent
env_file = os.getenv('GITHUB_ENV')
with open(env_file, "a") as myfile:
myfile.write(f"PYBAMM_PATH={pybamm_path}\n")
- name: Add tests folder to PyBaMM installation
run: |
ls -a ${{ env.PYBAMM_PATH }}
mv tests ${{ env.PYBAMM_PATH }}
- name: Run unit tests and integration tests with unittest
run: python -m unittest discover -s ${{ env.PYBAMM_PATH }}/tests/ --verbose

0 comments on commit 11dfa57

Please sign in to comment.