diff --git a/.github/workflows/test_on_push.yaml b/.github/workflows/test_on_push.yaml index 7b6c6f73..6811ce0a 100644 --- a/.github/workflows/test_on_push.yaml +++ b/.github/workflows/test_on_push.yaml @@ -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: @@ -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 diff --git a/noxfile.py b/noxfile.py index e88df260..d27e81b1 100644 --- a/noxfile.py +++ b/noxfile.py @@ -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