From 7bff31e68fa75d931aca4990e600a06719de71a5 Mon Sep 17 00:00:00 2001 From: Kwabena N Amponsah Date: Tue, 5 Nov 2024 09:55:56 +0000 Subject: [PATCH] #20 Rework cells example tests --- .../{test-cells.yml => test-cells-conda.yml} | 8 ++- .github/workflows/test-cells-ubuntu.yml | 68 +++++++++++++++++++ .../{test-shapes.yml => test-shapes-pip.yml} | 8 +-- README.md | 5 +- 4 files changed, 81 insertions(+), 8 deletions(-) rename .github/workflows/{test-cells.yml => test-cells-conda.yml} (92%) create mode 100644 .github/workflows/test-cells-ubuntu.yml rename .github/workflows/{test-shapes.yml => test-shapes-pip.yml} (91%) diff --git a/.github/workflows/test-cells.yml b/.github/workflows/test-cells-conda.yml similarity index 92% rename from .github/workflows/test-cells.yml rename to .github/workflows/test-cells-conda.yml index 13a5f81..ec34de4 100644 --- a/.github/workflows/test-cells.yml +++ b/.github/workflows/test-cells-conda.yml @@ -30,7 +30,7 @@ jobs: - name: Install system dependencies run: | sudo apt-get update - sudo apt-get install cmake + sudo apt-get install cmake git - name: Setup Miniconda Python ${{ matrix.python-version }} uses: conda-incubator/setup-miniconda@v3 @@ -79,7 +79,11 @@ jobs: working-directory: examples/cells - name: Build - run: python -m pip install -v . + run: conda build conda-recipe + working-directory: examples/cells + + - name: Install + run: conda install --use-local pycells working-directory: examples/cells - name: Test diff --git a/.github/workflows/test-cells-ubuntu.yml b/.github/workflows/test-cells-ubuntu.yml new file mode 100644 index 0000000..6adde86 --- /dev/null +++ b/.github/workflows/test-cells-ubuntu.yml @@ -0,0 +1,68 @@ +name: test-cells-ubuntu + +on: + workflow_dispatch: + pull_request: + branches: + - "**" + +concurrency: + group: test-cells-ubuntu-${{ github.ref }} + cancel-in-progress: true + +jobs: + test-cells-ubuntu: + runs-on: ubuntu-22.04 + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install system dependencies + run: | + sudo apt-get update + sudo apt-get install \ + cmake \ + git \ + libpetsc-real3.15 \ + libpetsc-real3.15-dbg \ + libpetsc-real3.15-dev \ + libvtk9-dev \ + mpi-default-bin \ + mpi-default-dev \ + python3-mpi4py \ + python3-petsc4py-real3.15 \ + python3-vtk9 \ + vtk9 + + - name: Install cppwg + run: | + python -m pip install --upgrade pip + python -m pip install . + + - name: Configure + run: | + mkdir build && cd build + cmake .. + working-directory: examples/cells + + - name: Regenerate wrappers + run: | + rm -rf dynamic/wrappers + cd build + make pycells_wrappers + working-directory: examples/cells + + - name: Check for changes + run: | + git diff --exit-code dynamic/wrappers + grep "Unknown class" build/cppwg.log + working-directory: examples/cells + + - name: Build + run: python -m pip install -v . + working-directory: examples/cells + + - name: Test + run: python -m unittest discover -s tests + working-directory: examples/cells diff --git a/.github/workflows/test-shapes.yml b/.github/workflows/test-shapes-pip.yml similarity index 91% rename from .github/workflows/test-shapes.yml rename to .github/workflows/test-shapes-pip.yml index 4c78676..bea7477 100644 --- a/.github/workflows/test-shapes.yml +++ b/.github/workflows/test-shapes-pip.yml @@ -1,4 +1,4 @@ -name: test-shapes +name: test-shapes-pip on: workflow_dispatch: @@ -7,7 +7,7 @@ on: - "**" jobs: - test-shapes: + test-shapes-pip: runs-on: ubuntu-latest strategy: @@ -16,7 +16,7 @@ jobs: python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] concurrency: - group: test-shapes-${{ github.ref }}-${{ matrix.python-version }} + group: test-shapes-pip-${{ github.ref }}-${{ matrix.python-version }} cancel-in-progress: true steps: @@ -26,7 +26,7 @@ jobs: - name: Install system dependencies run: | sudo apt-get update - sudo apt-get install cmake + sudo apt-get install cmake git - name: Setup Python ${{ matrix.python-version }} uses: actions/setup-python@v5 diff --git a/README.md b/README.md index 850f794..6bfddc8 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ -![shapes-example](https://github.com/Chaste/cppwg/actions/workflows/test-shapes.yml/badge.svg) -![cells-example](https://github.com/Chaste/cppwg/actions/workflows/test-cells.yml/badge.svg) +![conda](https://github.com/Chaste/cppwg/actions/workflows/test-cells-conda.yml/badge.svg) +![pip](https://github.com/Chaste/cppwg/actions/workflows/test-shapes-pip.yml/badge.svg) +![ubuntu](https://github.com/Chaste/cppwg/actions/workflows/test-cells-ubuntu.yml/badge.svg) # cppwg