From 9872a3a7957a72c9ff89db43ac4ad60fb540cf58 Mon Sep 17 00:00:00 2001 From: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com> Date: Sat, 25 May 2024 22:31:26 +0530 Subject: [PATCH] Running coverage tests together as well Signed-off-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com> --- .github/workflows/test_on_push.yml | 66 ++++-------------------------- 1 file changed, 9 insertions(+), 57 deletions(-) diff --git a/.github/workflows/test_on_push.yml b/.github/workflows/test_on_push.yml index 3cd921761f..19caa33c20 100644 --- a/.github/workflows/test_on_push.yml +++ b/.github/workflows/test_on_push.yml @@ -30,7 +30,7 @@ jobs: python -m pip install pre-commit pre-commit run -a - run_unit_and_integration_tests: + run_unit_integration_and_coverage_tests: needs: style runs-on: ${{ matrix.os }} strategy: @@ -42,7 +42,7 @@ jobs: 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 @@ -109,64 +109,16 @@ jobs: if: matrix.os != 'windows-latest' run: python -m nox -s pybamm-requires - - name: Run unit and integration tests for ${{ matrix.os }} with Python ${{ matrix.python-version }} + - name: Run unit/coverage and integration tests + shell: bash run: | - python -m nox -s unit + if [ ${{ matrix.python-version }} == "3.12" && ${{ matrix.os }} == "ubuntu-latest" ]; then + python -m nox -s coverage + else + python -m nox -s unit + fi python -m nox -s integration - 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 - run: | - sudo apt-get update - sudo dot -c - sudo apt-get install libopenblas-dev texlive-latex-extra dvipng - - - name: Set up Python 3.12 - id: setup-python - uses: actions/setup-python@v5 - with: - python-version: 3.12 - cache: 'pip' - - - name: Install nox - run: python -m pip install nox - - - name: Cache pybamm-requires nox environment for GNU/Linux - uses: actions/cache@v4 - with: - path: | - # Repository files - ${{ github.workspace }}/pybind11/ - ${{ github.workspace }}/install_KLU_Sundials/ - # Headers and dynamic library files for SuiteSparse and SUNDIALS - ${{ env.HOME }}/.local/lib/ - ${{ env.HOME }}/.local/include/ - key: nox-${{ matrix.os }}-pybamm-requires-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/install_KLU_Sundials.py', '**/noxfile.py', '**/test_on_push.yml') }} - - - name: Install SuiteSparse and SUNDIALS on GNU/Linux - timeout-minutes: 10 - run: python -m nox -s pybamm-requires - - - name: Run unit tests for Ubuntu with Python 3.11 and generate coverage report - run: python -m nox -s coverage - - name: Upload coverage report uses: codecov/codecov-action@v4.4.1 with: