Skip to content

Commit

Permalink
Running tests together on github-actions. (pybamm-team#4108)
Browse files Browse the repository at this point in the history
* Running tests together

Signed-off-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com>

* Running coverage tests together as well

Signed-off-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com>

* Added if condition to coverage tests

Signed-off-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com>

* Running integration tests as a seperate step

Signed-off-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com>

---------

Signed-off-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com>
Co-authored-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com>
  • Loading branch information
2 people authored and js1tr3 committed Aug 12, 2024
1 parent 98b45ab commit 135930b
Showing 1 changed file with 10 additions and 28 deletions.
38 changes: 10 additions & 28 deletions .github/workflows/test_on_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,15 @@ jobs:
python -m pip install pre-commit
pre-commit run -a
run_unit_tests:
run_unit_integration_and_coverage_tests:
needs: style
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-12, macos-14, windows-latest]
python-version: ["3.9", "3.10", "3.11", "3.12"]
# We check coverage on Ubuntu with Python 3.12, so we skip unit tests for it here
exclude:
- os: ubuntu-latest
python-version: "3.12"
name: Unit tests (${{ matrix.os }} / Python ${{ matrix.python-version }})
name: Tests (${{ matrix.os }} / Python ${{ matrix.python-version }})

steps:
- name: Check out PyBaMM repository
Expand Down Expand Up @@ -107,28 +103,8 @@ jobs:
if: matrix.os == 'ubuntu-latest'
run: python -m nox -s pybamm-requires

- name: Run unit tests for ${{ matrix.os }} with Python ${{ matrix.python-version }}
run: python -m nox -s unit

check_coverage:
needs: style
runs-on: ubuntu-latest
strategy:
fail-fast: false
name: Coverage tests (ubuntu-latest / Python 3.12)

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

- name: Install Linux system dependencies
uses: awalsh128/cache-apt-pkgs-action@v1.4.2
with:
packages: gfortran gcc graphviz pandoc
execute_install_scripts: true

# dot -c is for registering graphviz fonts and plugins
- name: Install OpenBLAS and TeXLive for Linux
- name: Run unit/coverage tests for ${{ matrix.os }} with Python ${{ matrix.python-version }}
shell: bash
run: |
sudo apt-get update
sudo dot -c
Expand Down Expand Up @@ -243,6 +219,12 @@ jobs:
- name: Run integration tests for ${{ matrix.os }} with Python ${{ matrix.python-version }}
run: python -m nox -s integration

- name: Upload coverage report
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
uses: codecov/codecov-action@v4.4.1
with:
token: ${{ secrets.CODECOV_TOKEN }}

# Skips IDAKLU module compilation for speedups, which is already tested in other jobs.
run_doctests:
needs: style
Expand Down

0 comments on commit 135930b

Please sign in to comment.