diff --git a/.github/workflows/test-cells-conda.yml b/.github/workflows/test-cells-conda.yml index 23e490a..7a4e1e4 100644 --- a/.github/workflows/test-cells-conda.yml +++ b/.github/workflows/test-cells-conda.yml @@ -9,9 +9,11 @@ on: jobs: test-cells-conda: runs-on: ubuntu-latest + timeout-minutes: 90 strategy: fail-fast: false + max-parallel: 2 matrix: python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] @@ -24,19 +26,26 @@ jobs: shell: bash -el {0} # -l needed to activate conda steps: + - name: Staggered sleep + run: | + if [[ "${{ matrix.python-version }}" == '3.8' ]]; then + echo "Sleeping for 3 minutes to stagger the start of the workflow..." + sleep 3m + fi + - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Install system dependencies run: | sudo apt-get update sudo apt-get install castxml clang cmake git + sudo apt-get install freeglut3-dev libglew-dev mesa-utils openbox xauth xorg - name: Setup Miniconda Python ${{ matrix.python-version }} uses: conda-incubator/setup-miniconda@v3 with: auto-update-conda: true - use-mamba: true miniforge-version: latest python-version: ${{ matrix.python-version }} channels: conda-forge,defaults @@ -44,13 +53,24 @@ jobs: - name: Install cppwg run: | - python -m pip install --upgrade pip - python -m pip install . + python3 -m pip install --upgrade pip + python3 -m pip install . - name: Install requirements - run: mamba install --yes --file conda/requirements.txt + run: | + conda clean --all --yes + conda config --prepend channels conda-forge + conda config --set channel_priority strict + conda config --get channels + conda install --yes -vv --file conda/requirements.txt working-directory: examples/cells + - name: Install conda-build tools + run: | + conda config --set channel_priority flexible + conda config --get channels + conda install --yes -vv boa conda-build conda-verify + - name: Set config paths run: | echo "CMAKE_PREFIX_PATH=$CONDA_PREFIX;$CMAKE_PREFIX_PATH" >> $GITHUB_ENV @@ -77,17 +97,15 @@ jobs: grep "Unknown class" build/cppwg.log working-directory: examples/cells - - name: Install conda-build tools - run: mamba install boa conda-build conda-verify - - name: Build run: | - conda mambabuild recipe -m variants/python${{ matrix.python-version }}.yaml + conda build recipe -m variants/python${{ matrix.python-version }}.yaml --output-folder ./build working-directory: examples/cells/conda - name: Install - run: mamba install --use-local pycells + run: conda install -c ./build pycells + working-directory: examples/cells/conda - name: Test - run: python -m unittest discover tests + run: python3 -m unittest discover tests working-directory: examples/cells diff --git a/.github/workflows/test-cells-ubuntu.yml b/.github/workflows/test-cells-ubuntu.yml index 715b687..c01790c 100644 --- a/.github/workflows/test-cells-ubuntu.yml +++ b/.github/workflows/test-cells-ubuntu.yml @@ -8,15 +8,18 @@ on: jobs: test-cells-ubuntu: - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest strategy: fail-fast: false matrix: - os: ["ubuntu-22.04", "ubuntu-24.04"] + image: ["ubuntu:22.04", "ubuntu:24.04", "ubuntu:25.10"] + + container: + image: ${{ matrix.image }} concurrency: - group: test-cells-ubuntu-${{ github.ref }}-${{ matrix.os }} + group: test-cells-ubuntu-${{ github.ref }}-${{ matrix.image }} cancel-in-progress: true defaults: @@ -24,41 +27,53 @@ jobs: shell: bash -el {0} # -l needed to activate pipx steps: + - name: Install git + run: | + apt-get update + apt-get install -y git + - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - - name: Install system dependencies + - name: Set git safe directory run: | - sudo apt-get update + git config --global --add safe.directory $PWD - for vtk_ver in $(seq 7 9); do - available=1 - dpkg -s "libvtk${vtk_ver}-dev" || available=0 - if [ "${available}" -eq 1 ]; then + - name: Get system VTK version + run: | + vtk_ver= + for candidate in $(seq 7 99); do + vtk_pkg="$(apt-cache search --names-only ^libvtk${candidate}-dev$)" + if [ -n "${vtk_pkg}" ]; then + vtk_ver="${candidate}" break fi done echo "VTK version: ${vtk_ver}" + echo "VTK_VERSION=${vtk_ver}" >> $GITHUB_ENV - sudo apt-get install \ + - name: Install system dependencies + run: | + export DEBIAN_FRONTEND=noninteractive + apt-get install -y \ castxml \ clang \ cmake \ - git \ libboost-all-dev \ libpetsc-real-dev \ - libvtk${vtk_ver}-dev \ + libvtk${{ env.VTK_VERSION }}-dev \ mpi-default-bin \ mpi-default-dev \ pipx \ python3-mpi4py \ python3-petsc4py-real \ python3-pip \ - python3-vtk${vtk_ver} + python3-vtk${{ env.VTK_VERSION }} pipx ensurepath - # Check installed package versions + - name: Check installed package versions + run: | dpkg-query -W \ castxml \ clang \ @@ -66,14 +81,14 @@ jobs: git \ libboost-all-dev \ libpetsc-real-dev \ - libvtk${vtk_ver}-dev \ + libvtk${{ env.VTK_VERSION }}-dev \ mpi-default-bin \ mpi-default-dev \ pipx \ python3-mpi4py \ python3-petsc4py-real \ python3-pip \ - python3-vtk${vtk_ver} + python3-vtk${{ env.VTK_VERSION }} - name: Install cppwg run: pipx install . @@ -97,15 +112,21 @@ jobs: grep "Unknown class" build/cppwg.log working-directory: examples/cells - - name: Build + - name: Create build env run: | python3 -m venv --system-site-packages .venv - . .venv/bin/activate + . .venv/bin/activate && \ + python3 -m pip install --upgrade pip + working-directory: examples/cells + + - name: Build + run: | + . .venv/bin/activate && \ python3 -m pip install -v . working-directory: examples/cells - name: Test run: | - . .venv/bin/activate + . .venv/bin/activate && \ python3 -m unittest discover tests working-directory: examples/cells diff --git a/.github/workflows/test-shapes-pip.yml b/.github/workflows/test-shapes-pip.yml index a7d01b8..0d0d2f8 100644 --- a/.github/workflows/test-shapes-pip.yml +++ b/.github/workflows/test-shapes-pip.yml @@ -21,22 +21,22 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Install system dependencies run: | sudo apt-get update - sudo apt-get install castxml clang cmake git + sudo apt-get install -y castxml clang cmake git - name: Setup Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} - name: Install cppwg run: | - python -m pip install --upgrade pip - python -m pip install . + python3 -m pip install --upgrade pip + python3 -m pip install . - name: Regenerate wrappers run: | @@ -67,6 +67,6 @@ jobs: - name: Test run: | - python -m unittest test_functions.py - python -m unittest test_classes.py + python3 -m unittest test_functions.py + python3 -m unittest test_classes.py working-directory: examples/shapes/build diff --git a/.github/workflows/test-style.yml b/.github/workflows/test-style.yml index 7a9038d..47d8455 100644 --- a/.github/workflows/test-style.yml +++ b/.github/workflows/test-style.yml @@ -16,7 +16,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Install dependencies run: | @@ -25,10 +25,10 @@ jobs: - name: Install cppwg run: | - python -m pip install --upgrade pip - python -m pip install .[dev] + python3 -m pip install --upgrade pip + python3 -m pip install .[dev] - name: Lint run: | - python -m flake8 --version - python -m flake8 . + python3 -m flake8 --version + python3 -m flake8 . diff --git a/README.md b/README.md index 3b48845..897924d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -![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) -![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?branch=develop) +![ubuntu](https://github.com/Chaste/cppwg/actions/workflows/test-cells-ubuntu.yml/badge.svg?branch=develop) +![conda](https://github.com/Chaste/cppwg/actions/workflows/test-cells-conda.yml/badge.svg?branch=develop) # cppwg