From ce8c0f5e0798f5eb5d96263312dec7cc43cc5f50 Mon Sep 17 00:00:00 2001 From: Stefan Possanner Date: Fri, 7 Nov 2025 10:49:06 +0100 Subject: [PATCH 01/12] split jobs into separate workflows --- .../workflows/compile-with-pyccel-devel.yml | 181 ++++++++++ .github/workflows/test-struphy.yml | 160 +++++++++ .github/workflows/testing.yml | 328 ------------------ 3 files changed, 341 insertions(+), 328 deletions(-) create mode 100644 .github/workflows/compile-with-pyccel-devel.yml create mode 100644 .github/workflows/test-struphy.yml diff --git a/.github/workflows/compile-with-pyccel-devel.yml b/.github/workflows/compile-with-pyccel-devel.yml new file mode 100644 index 000000000..958badbf0 --- /dev/null +++ b/.github/workflows/compile-with-pyccel-devel.yml @@ -0,0 +1,181 @@ +on: + push: + branches: [ devel-tiny, devel, main ] + pull_request: + branches: [ devel-tiny, devel, main ] + +jobs: + compile-with-pyccel-devel: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ ubuntu-latest ] + # TODO: Make sure that struphy works with python > 3.11, keep the lower bound to 3.10 + python-version: [ '3.10', '3.12', '3.13' ] + compile_language: ['c', 'fortran'] + isMerge: + - ${{ github.event_name == 'push' && github.ref == 'refs/heads/devel' }} + # exclude: + # - { isMerge: false, python-version: '3.10' } + # - { isMerge: false, python-version: '3.11' } + # include: + # - os: macos-14 + # python-version: '3.10' + # - os: macos-14 + # python-version: '3.13' + + name: Compile psydac w. pyccel devel on ${{ matrix.os }} / Python ${{ matrix.python-version }} / ${{ matrix.compile_language }} + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + cache: 'pip' + cache-dependency-path: | + pyproject.toml + requirements.txt + + - name: Install non-Python dependencies on Ubuntu + if: matrix.os == 'ubuntu-latest' + uses: awalsh128/cache-apt-pkgs-action@latest + with: + packages: gfortran openmpi-bin libopenmpi-dev libhdf5-openmpi-dev + version: 1.0 + execute_install_scripts: true + + # When loading cached apt packages, the default MPI compiler isn't set. + # Workaround is to 'reinstall' openmpi-bin, which doesn't actually perform + # installation (since openmpi-bin already exists), but instead reruns + # `update-alternatives` which fixes the symlinks to mpicc/mpif90. + - name: Reconfigure non-Python dependencies on Ubuntu + if: matrix.os == 'ubuntu-latest' + run: | + sudo apt-get update + sudo apt-get install --reinstall openmpi-bin libhdf5-openmpi-dev liblapack-dev libblas-dev + + - name: Install non-Python dependencies on macOS + if: matrix.os == 'macos-14' + run: | + brew install make + brew install open-mpi + brew install hdf5-mpi + brew install libomp + brew update + brew install python3 + brew install gcc + brew install openblas + brew install lapack + brew install git + brew install pandoc + GFORTRAN_HOME=$(which gfortran || true) + echo "GFORTRAN_HOME : $GFORTRAN_HOME" + if [[ ! -f "$GFORTRAN_HOME" ]]; then + gfort=$(find ${PATH//:/\/ } -name 'gfortran-*' -exec basename {} \; | sort | tail -n 1 || true) + echo "Found $gfort" + gfort_path=$(which ${gfort}) + folder=$(dirname ${gfort_path}) + ln -s ${gfort_path} ${folder}/gfortran + fi + echo "MPI_OPTS=--oversubscribe" >> $GITHUB_ENV + echo "/opt/homebrew/opt/make/libexec/gnubin" >> $GITHUB_PATH + + - name: Print information on MPI and HDF5 libraries + run: | + ompi_info + h5pcc -showconfig -echo || true + + - name: Upgrade pip + run: | + python -m pip install --upgrade pip + + - name: Determine directory of parallel HDF5 library + run: | + if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then + HDF5_DIR=$(dpkg -L libhdf5-openmpi-dev | grep libhdf5.so | xargs dirname) + elif [[ "${{ matrix.os }}" == "macos-14" ]]; then + HDF5_DIR=$(brew list hdf5-mpi | grep "libhdf5.dylib" | xargs dirname | xargs dirname) + fi + echo $HDF5_DIR + echo "HDF5_DIR=$HDF5_DIR" >> $GITHUB_ENV + + - name: Cache PETSc + uses: actions/cache@v4 + id: cache-petsc + env: + cache-name: cache-PETSc + with: + path: "./petsc" + key: petsc-${{ matrix.os }}-${{ matrix.python-version }} + + - if: steps.cache-petsc.outputs.cache-hit != 'true' + name: Download a specific release of PETSc + run: | + git clone --depth 1 --branch v3.23.3 https://gitlab.com/petsc/petsc.git + + - if: steps.cache-petsc.outputs.cache-hit != 'true' + name: Install PETSc with complex support + working-directory: ./petsc + run: | + export PETSC_DIR=$(pwd) + export PETSC_ARCH=petsc-cmplx + ./configure --with-scalar-type=complex --with-fortran-bindings=0 --have-numpy=1 --download-fblaslapack=1 + make all + echo "PETSC_DIR=$PETSC_DIR" > petsc.env + echo "PETSC_ARCH=$PETSC_ARCH" >> petsc.env + + # This step is not really necessary and could be combined with PETSc install + # step; however it's good to verify if the cached PETSc installation really works! + - name: Test PETSc installation + working-directory: ./petsc + run: | + source petsc.env + make check + echo "PETSC_DIR=$PETSC_DIR" >> $GITHUB_ENV + echo "PETSC_ARCH=$PETSC_ARCH" >> $GITHUB_ENV + + - name: Install petsc4py + working-directory: ./petsc + run: | + python -m pip install wheel Cython numpy + python -m pip install src/binding/petsc4py + + # - name: Check parallel h5py installation + # run: | + # python -c " + # from mpi4py import MPI + # import h5py + # # This particular instantiation of h5py.File will fail if parallel h5py isn't installed + # f = h5py.File('parallel_test.hdf5', 'w', driver='mpio', comm=MPI.COMM_WORLD) + # print(f)" + + - name: Install project + run: | + python -m pip install ".[test]" --no-cache-dir + python -m pip freeze + + - name: Set up environment variables + run: | + echo "PSYDAC_DIR=$GITHUB_WORKSPACE" >> $GITHUB_ENV + echo "PYCCEL_DIR=$GITHUB_WORKSPACE/pyccel" >> $GITHUB_ENV + + - name: Clone pyccel from Github (devel branch) + run: | + git clone --recurse-submodules https://github.com/pyccel/pyccel.git $PYCCEL_DIR + + - name: Install pyccel + working-directory: ${{ env.PYCCEL_DIR }} + run: | + echo "Pyccel location for this branch" + pip show pyccel + pip uninstall pyccel -y + python -m pip install ".[test]" --no-cache-dir + echo "Pyccel location after reinstalling" + pip show pyccel + + - name: Compile psydac kernels + run: | + psydac-accelerate --language ${{ matrix.compile_language }} diff --git a/.github/workflows/test-struphy.yml b/.github/workflows/test-struphy.yml new file mode 100644 index 000000000..d5e076acd --- /dev/null +++ b/.github/workflows/test-struphy.yml @@ -0,0 +1,160 @@ +on: + push: + branches: [ devel-tiny, devel, main ] + pull_request: + branches: [ devel-tiny, devel, main ] + +jobs: + test_struphy: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ ubuntu-latest ] + # TODO: Make sure that struphy works with python > 3.11, keep the lower bound to 3.10 + python-version: [ '3.10', '3.12', '3.13' ] + compile_language: ['c', 'fortran'] + isMerge: + - ${{ github.event_name == 'push' && github.ref == 'refs/heads/devel' }} + # exclude: + # - { isMerge: false, python-version: '3.10' } + # - { isMerge: false, python-version: '3.11' } + # include: + # - os: macos-14 + # python-version: '3.10' + # - os: macos-14 + # python-version: '3.13' + + name: Test Struphy on ${{ matrix.os }} / Python ${{ matrix.python-version }} / ${{ matrix.compile_language }} + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + cache: 'pip' + cache-dependency-path: | + pyproject.toml + requirements.txt + + - name: Install non-Python dependencies on Ubuntu + if: matrix.os == 'ubuntu-latest' + uses: awalsh128/cache-apt-pkgs-action@latest + with: + packages: gfortran openmpi-bin libopenmpi-dev libhdf5-openmpi-dev g++ liblapack3 cmake cmake-curses-gui zlib1g-dev libnetcdf-dev libnetcdff-dev + version: 1.0 + execute_install_scripts: true + + # When loading cached apt packages, the default MPI compiler isn't set. + # Workaround is to 'reinstall' openmpi-bin, which doesn't actually perform + # installation (since openmpi-bin already exists), but instead reruns + # `update-alternatives` which fixes the symlinks to mpicc/mpif90. + - name: Reconfigure non-Python dependencies on Ubuntu + if: matrix.os == 'ubuntu-latest' + run: | + sudo apt-get update + sudo apt-get install --reinstall openmpi-bin libhdf5-openmpi-dev liblapack-dev libblas-dev liblapack3 + + - name: Install non-Python dependencies on macOS + if: matrix.os == 'macos-14' + run: | + brew install open-mpi + brew install hdf5-mpi + brew install libomp + brew update + brew install python3 + brew install gcc + brew install openblas + brew install lapack + brew install git + brew install pandoc + brew install cmake + brew install netcdf-fortran + brew install pkgconf + GFORTRAN_HOME=$(which gfortran || true) + echo "GFORTRAN_HOME : $GFORTRAN_HOME" + if [[ ! -f "$GFORTRAN_HOME" ]]; then + gfort=$(find ${PATH//:/\/ } -name 'gfortran-*' -exec basename {} \; | sort | tail -n 1 || true) + echo "Found $gfort" + gfort_path=$(which ${gfort}) + folder=$(dirname ${gfort_path}) + ln -s ${gfort_path} ${folder}/gfortran + fi + echo "MPI_OPTS=--oversubscribe" >> $GITHUB_ENV + + - name: Print information on MPI and HDF5 libraries + run: | + ompi_info + h5pcc -showconfig -echo || true + + - name: Upgrade pip + run: | + python -m pip install --upgrade pip + + - name: Install project without mpi + run: | + python -m pip install ".[test]" --no-cache-dir + python -m pip freeze + + - name: Set up environment variables + run: | + echo "PSYDAC_DIR=$GITHUB_WORKSPACE" >> $GITHUB_ENV + echo "STRUPHY_DIR=$GITHUB_WORKSPACE/struphy" >> $GITHUB_ENV + + - name: Clone struphy from GitLab + run: | + git clone https://gitlab.mpcdf.mpg.de/struphy/struphy.git $STRUPHY_DIR + + - name: Install struphy without mpi #TODO: Set branch to devel + working-directory: ${{ env.STRUPHY_DIR }} + run: | + echo "Psydac location for this branch" + pip show psydac + pip uninstall psydac -y + python -m pip install ".[phys]" --no-cache-dir + echo "Psydac location after installing struphy" + pip show psydac + + - name: Re-install Psydac from the current branch + run: | + echo "Uninstall psydac" + psydac-accelerate --cleanup --yes + pip show psydac + pip uninstall psydac -y + python -m pip install ${{ env.PSYDAC_DIR }} --force-reinstall --no-cache-dir + echo "Psydac location after installing psydac from the current branch (should be the same as in the previous step)" + pip show psydac + + - name: Compile struphy + working-directory: ${{ env.STRUPHY_DIR }} + run: | + pip show psydac + struphy -h + struphy compile -y --language ${{ matrix.compile_language }} + + - name: Run struphy unit tests + working-directory: ${{ env.STRUPHY_DIR }} + run: | + struphy test unit + + - name: Run struphy model tests + working-directory: ${{ env.STRUPHY_DIR }} + run: | + struphy test models --fast + + - name: Install mpi4py + working-directory: ${{ env.STRUPHY_DIR }} + run: | + pip install -U mpi4py + + - name: Run struphy unit tests with mpi + working-directory: ${{ env.STRUPHY_DIR }} + run: | + struphy test unit --mpi 2 + + - name: Remove test directory + if: always() + run: | + rm -rf pytest diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 2c425379c..b218e92a1 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -8,181 +8,6 @@ on: branches: [ devel-tiny, devel, main ] jobs: - compile-with-pyccel-devel: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ ubuntu-latest ] - # TODO: Make sure that struphy works with python > 3.11, keep the lower bound to 3.10 - python-version: [ '3.10', '3.12', '3.13' ] - compile_language: ['c', 'fortran'] - isMerge: - - ${{ github.event_name == 'push' && github.ref == 'refs/heads/devel' }} - # exclude: - # - { isMerge: false, python-version: '3.10' } - # - { isMerge: false, python-version: '3.11' } - # include: - # - os: macos-14 - # python-version: '3.10' - # - os: macos-14 - # python-version: '3.13' - - name: Compile psydac w. pyccel devel on ${{ matrix.os }} / Python ${{ matrix.python-version }} / ${{ matrix.compile_language }} - - steps: - - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - cache: 'pip' - cache-dependency-path: | - pyproject.toml - requirements.txt - - - name: Install non-Python dependencies on Ubuntu - if: matrix.os == 'ubuntu-latest' - uses: awalsh128/cache-apt-pkgs-action@latest - with: - packages: gfortran openmpi-bin libopenmpi-dev libhdf5-openmpi-dev - version: 1.0 - execute_install_scripts: true - - # When loading cached apt packages, the default MPI compiler isn't set. - # Workaround is to 'reinstall' openmpi-bin, which doesn't actually perform - # installation (since openmpi-bin already exists), but instead reruns - # `update-alternatives` which fixes the symlinks to mpicc/mpif90. - - name: Reconfigure non-Python dependencies on Ubuntu - if: matrix.os == 'ubuntu-latest' - run: | - sudo apt-get update - sudo apt-get install --reinstall openmpi-bin libhdf5-openmpi-dev liblapack-dev libblas-dev - - - name: Install non-Python dependencies on macOS - if: matrix.os == 'macos-14' - run: | - brew install make - brew install open-mpi - brew install hdf5-mpi - brew install libomp - brew update - brew install python3 - brew install gcc - brew install openblas - brew install lapack - brew install git - brew install pandoc - GFORTRAN_HOME=$(which gfortran || true) - echo "GFORTRAN_HOME : $GFORTRAN_HOME" - if [[ ! -f "$GFORTRAN_HOME" ]]; then - gfort=$(find ${PATH//:/\/ } -name 'gfortran-*' -exec basename {} \; | sort | tail -n 1 || true) - echo "Found $gfort" - gfort_path=$(which ${gfort}) - folder=$(dirname ${gfort_path}) - ln -s ${gfort_path} ${folder}/gfortran - fi - echo "MPI_OPTS=--oversubscribe" >> $GITHUB_ENV - echo "/opt/homebrew/opt/make/libexec/gnubin" >> $GITHUB_PATH - - - name: Print information on MPI and HDF5 libraries - run: | - ompi_info - h5pcc -showconfig -echo || true - - - name: Upgrade pip - run: | - python -m pip install --upgrade pip - - - name: Determine directory of parallel HDF5 library - run: | - if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then - HDF5_DIR=$(dpkg -L libhdf5-openmpi-dev | grep libhdf5.so | xargs dirname) - elif [[ "${{ matrix.os }}" == "macos-14" ]]; then - HDF5_DIR=$(brew list hdf5-mpi | grep "libhdf5.dylib" | xargs dirname | xargs dirname) - fi - echo $HDF5_DIR - echo "HDF5_DIR=$HDF5_DIR" >> $GITHUB_ENV - - - name: Cache PETSc - uses: actions/cache@v4 - id: cache-petsc - env: - cache-name: cache-PETSc - with: - path: "./petsc" - key: petsc-${{ matrix.os }}-${{ matrix.python-version }} - - - if: steps.cache-petsc.outputs.cache-hit != 'true' - name: Download a specific release of PETSc - run: | - git clone --depth 1 --branch v3.23.3 https://gitlab.com/petsc/petsc.git - - - if: steps.cache-petsc.outputs.cache-hit != 'true' - name: Install PETSc with complex support - working-directory: ./petsc - run: | - export PETSC_DIR=$(pwd) - export PETSC_ARCH=petsc-cmplx - ./configure --with-scalar-type=complex --with-fortran-bindings=0 --have-numpy=1 --download-fblaslapack=1 - make all - echo "PETSC_DIR=$PETSC_DIR" > petsc.env - echo "PETSC_ARCH=$PETSC_ARCH" >> petsc.env - - # This step is not really necessary and could be combined with PETSc install - # step; however it's good to verify if the cached PETSc installation really works! - - name: Test PETSc installation - working-directory: ./petsc - run: | - source petsc.env - make check - echo "PETSC_DIR=$PETSC_DIR" >> $GITHUB_ENV - echo "PETSC_ARCH=$PETSC_ARCH" >> $GITHUB_ENV - - - name: Install petsc4py - working-directory: ./petsc - run: | - python -m pip install wheel Cython numpy - python -m pip install src/binding/petsc4py - - # - name: Check parallel h5py installation - # run: | - # python -c " - # from mpi4py import MPI - # import h5py - # # This particular instantiation of h5py.File will fail if parallel h5py isn't installed - # f = h5py.File('parallel_test.hdf5', 'w', driver='mpio', comm=MPI.COMM_WORLD) - # print(f)" - - - name: Install project - run: | - python -m pip install ".[test]" --no-cache-dir - python -m pip freeze - - - name: Set up environment variables - run: | - echo "PSYDAC_DIR=$GITHUB_WORKSPACE" >> $GITHUB_ENV - echo "PYCCEL_DIR=$GITHUB_WORKSPACE/pyccel" >> $GITHUB_ENV - - - name: Clone pyccel from Github (devel branch) - run: | - git clone --recurse-submodules https://github.com/pyccel/pyccel.git $PYCCEL_DIR - - - name: Install pyccel - working-directory: ${{ env.PYCCEL_DIR }} - run: | - echo "Pyccel location for this branch" - pip show pyccel - pip uninstall pyccel -y - python -m pip install ".[test]" --no-cache-dir - echo "Pyccel location after reinstalling" - pip show pyccel - - - name: Compile psydac kernels - run: | - psydac-accelerate --language ${{ matrix.compile_language }} - test_psydac: runs-on: ${{ matrix.os }} strategy: @@ -387,156 +212,3 @@ jobs: run: | rm -rf pytest - test_struphy: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ ubuntu-latest ] - # TODO: Make sure that struphy works with python > 3.11, keep the lower bound to 3.10 - python-version: [ '3.10', '3.12', '3.13' ] - compile_language: ['c', 'fortran'] - isMerge: - - ${{ github.event_name == 'push' && github.ref == 'refs/heads/devel' }} - # exclude: - # - { isMerge: false, python-version: '3.10' } - # - { isMerge: false, python-version: '3.11' } - # include: - # - os: macos-14 - # python-version: '3.10' - # - os: macos-14 - # python-version: '3.13' - - name: Test Struphy on ${{ matrix.os }} / Python ${{ matrix.python-version }} / ${{ matrix.compile_language }} - - steps: - - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - cache: 'pip' - cache-dependency-path: | - pyproject.toml - requirements.txt - - - name: Install non-Python dependencies on Ubuntu - if: matrix.os == 'ubuntu-latest' - uses: awalsh128/cache-apt-pkgs-action@latest - with: - packages: gfortran openmpi-bin libopenmpi-dev libhdf5-openmpi-dev g++ liblapack3 cmake cmake-curses-gui zlib1g-dev libnetcdf-dev libnetcdff-dev - version: 1.0 - execute_install_scripts: true - - # When loading cached apt packages, the default MPI compiler isn't set. - # Workaround is to 'reinstall' openmpi-bin, which doesn't actually perform - # installation (since openmpi-bin already exists), but instead reruns - # `update-alternatives` which fixes the symlinks to mpicc/mpif90. - - name: Reconfigure non-Python dependencies on Ubuntu - if: matrix.os == 'ubuntu-latest' - run: | - sudo apt-get update - sudo apt-get install --reinstall openmpi-bin libhdf5-openmpi-dev liblapack-dev libblas-dev liblapack3 - - - name: Install non-Python dependencies on macOS - if: matrix.os == 'macos-14' - run: | - brew install open-mpi - brew install hdf5-mpi - brew install libomp - brew update - brew install python3 - brew install gcc - brew install openblas - brew install lapack - brew install git - brew install pandoc - brew install cmake - brew install netcdf-fortran - brew install pkgconf - GFORTRAN_HOME=$(which gfortran || true) - echo "GFORTRAN_HOME : $GFORTRAN_HOME" - if [[ ! -f "$GFORTRAN_HOME" ]]; then - gfort=$(find ${PATH//:/\/ } -name 'gfortran-*' -exec basename {} \; | sort | tail -n 1 || true) - echo "Found $gfort" - gfort_path=$(which ${gfort}) - folder=$(dirname ${gfort_path}) - ln -s ${gfort_path} ${folder}/gfortran - fi - echo "MPI_OPTS=--oversubscribe" >> $GITHUB_ENV - - - name: Print information on MPI and HDF5 libraries - run: | - ompi_info - h5pcc -showconfig -echo || true - - - name: Upgrade pip - run: | - python -m pip install --upgrade pip - - - name: Install project without mpi - run: | - python -m pip install ".[test]" --no-cache-dir - python -m pip freeze - - - name: Set up environment variables - run: | - echo "PSYDAC_DIR=$GITHUB_WORKSPACE" >> $GITHUB_ENV - echo "STRUPHY_DIR=$GITHUB_WORKSPACE/struphy" >> $GITHUB_ENV - - - name: Clone struphy from GitLab - run: | - git clone https://gitlab.mpcdf.mpg.de/struphy/struphy.git $STRUPHY_DIR - - - name: Install struphy without mpi #TODO: Set branch to devel - working-directory: ${{ env.STRUPHY_DIR }} - run: | - echo "Psydac location for this branch" - pip show psydac - pip uninstall psydac -y - python -m pip install ".[phys]" --no-cache-dir - echo "Psydac location after installing struphy" - pip show psydac - - - name: Re-install Psydac from the current branch - run: | - echo "Uninstall psydac" - psydac-accelerate --cleanup --yes - pip show psydac - pip uninstall psydac -y - python -m pip install ${{ env.PSYDAC_DIR }} --force-reinstall --no-cache-dir - echo "Psydac location after installing psydac from the current branch (should be the same as in the previous step)" - pip show psydac - - - name: Compile struphy - working-directory: ${{ env.STRUPHY_DIR }} - run: | - pip show psydac - struphy -h - struphy compile -y --language ${{ matrix.compile_language }} - - - name: Run struphy unit tests - working-directory: ${{ env.STRUPHY_DIR }} - run: | - struphy test unit - - - name: Run struphy model tests - working-directory: ${{ env.STRUPHY_DIR }} - run: | - struphy test models --fast - - - name: Install mpi4py - working-directory: ${{ env.STRUPHY_DIR }} - run: | - pip install -U mpi4py - - - name: Run struphy unit tests with mpi - working-directory: ${{ env.STRUPHY_DIR }} - run: | - struphy test unit --mpi 2 - - - name: Remove test directory - if: always() - run: | - rm -rf pytest From 15d3d93a8e1e1e4ce622cfd1b4130ab1c098d9c8 Mon Sep 17 00:00:00 2001 From: Stefan Possanner Date: Fri, 7 Nov 2025 10:49:35 +0100 Subject: [PATCH 02/12] removed disabled workflow --- .github/workflows/documentation.yml.disabled | 65 -------------------- 1 file changed, 65 deletions(-) delete mode 100644 .github/workflows/documentation.yml.disabled diff --git a/.github/workflows/documentation.yml.disabled b/.github/workflows/documentation.yml.disabled deleted file mode 100644 index 41896bbb9..000000000 --- a/.github/workflows/documentation.yml.disabled +++ /dev/null @@ -1,65 +0,0 @@ -name: Documentation - -on: - push: - branches: [ devel ] - paths: - - 'docs/**' - - 'psydac/**.py' - - pull_request: - branches: [ devel ] - paths: - - 'docs/**' - - 'psydac/**.py' - - workflow_dispatch: - -permissions: - contents: read - pages: write - id-token: write - -jobs: - build_docs: - runs-on: ubuntu-latest - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN}} - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: 3.9 - - name: Install non-Python dependencies on Ubuntu - run: | - sudo apt update - sudo apt install graphviz - - name: Install Python dependencies - run: | - python -m pip install -r docs/requirements.txt - - name: Make the sphinx doc - run: | - rm -rf docs/source/modules/STUBDIR - make -C docs clean - make -C docs html - python docs/update_links.py - - name: Setup Pages - uses: actions/configure-pages@v5 - - name: Upload artifact - uses: actions/upload-pages-artifact@v3 - with: - path: 'docs/build/html' - - deploy_docs: - if: github.event_name == 'push' && github.ref == 'refs/heads/devel' - needs: build_docs - runs-on: ubuntu-latest - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - steps: - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 From 9e2da67ee4c4c5fbda5ef379172bc6f153ef8c16 Mon Sep 17 00:00:00 2001 From: Stefan Possanner Date: Fri, 7 Nov 2025 10:53:30 +0100 Subject: [PATCH 03/12] renamed workflow --- .github/workflows/{testing.yml => test-psydac.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{testing.yml => test-psydac.yml} (100%) diff --git a/.github/workflows/testing.yml b/.github/workflows/test-psydac.yml similarity index 100% rename from .github/workflows/testing.yml rename to .github/workflows/test-psydac.yml From 5dae4d4a561c51f368e007c8d16d25b8527a5589 Mon Sep 17 00:00:00 2001 From: Stefan Possanner Date: Fri, 7 Nov 2025 11:15:05 +0100 Subject: [PATCH 04/12] try using an action for installing prerequisites --- .../actions/install/psydac-req/action.yml | 132 ++++++++++++++++++ .../workflows/compile-with-pyccel-devel.yml | 127 +---------------- .github/workflows/test-psydac.yml | 126 +---------------- .github/workflows/test-struphy.yml | 66 +-------- 4 files changed, 141 insertions(+), 310 deletions(-) create mode 100644 .github/workflows/actions/install/psydac-req/action.yml diff --git a/.github/workflows/actions/install/psydac-req/action.yml b/.github/workflows/actions/install/psydac-req/action.yml new file mode 100644 index 000000000..4b98614f2 --- /dev/null +++ b/.github/workflows/actions/install/psydac-req/action.yml @@ -0,0 +1,132 @@ +name: Install prerequisites + +runs: + using: composite + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + cache: 'pip' + cache-dependency-path: | + pyproject.toml + requirements.txt + + - name: Install non-Python dependencies on Ubuntu + if: matrix.os == 'ubuntu-latest' + uses: awalsh128/cache-apt-pkgs-action@latest + with: + packages: gfortran openmpi-bin libopenmpi-dev libhdf5-openmpi-dev g++ liblapack3 cmake cmake-curses-gui zlib1g-dev libnetcdf-dev libnetcdff-dev + version: 1.0 + execute_install_scripts: true + + # When loading cached apt packages, the default MPI compiler isn't set. + # Workaround is to 'reinstall' openmpi-bin, which doesn't actually perform + # installation (since openmpi-bin already exists), but instead reruns + # `update-alternatives` which fixes the symlinks to mpicc/mpif90. + - name: Reconfigure non-Python dependencies on Ubuntu + if: matrix.os == 'ubuntu-latest' + run: | + sudo apt-get update + sudo apt-get install --reinstall openmpi-bin libhdf5-openmpi-dev liblapack-dev libblas-dev + + - name: Install non-Python dependencies on macOS + if: matrix.os == 'macos-14' + run: | + brew install make + brew install open-mpi + brew install hdf5-mpi + brew install libomp + brew update + brew install python3 + brew install gcc + brew install openblas + brew install lapack + brew install git + brew install pandoc + brew install cmake + brew install netcdf-fortran + brew install pkgconf + GFORTRAN_HOME=$(which gfortran || true) + echo "GFORTRAN_HOME : $GFORTRAN_HOME" + if [[ ! -f "$GFORTRAN_HOME" ]]; then + gfort=$(find ${PATH//:/\/ } -name 'gfortran-*' -exec basename {} \; | sort | tail -n 1 || true) + echo "Found $gfort" + gfort_path=$(which ${gfort}) + folder=$(dirname ${gfort_path}) + ln -s ${gfort_path} ${folder}/gfortran + fi + echo "MPI_OPTS=--oversubscribe" >> $GITHUB_ENV + echo "/opt/homebrew/opt/make/libexec/gnubin" >> $GITHUB_PATH + + - name: Print information on MPI and HDF5 libraries + run: | + ompi_info + h5pcc -showconfig -echo || true + + - name: Upgrade pip + run: | + python -m pip install --upgrade pip + + - name: Determine directory of parallel HDF5 library + run: | + if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then + HDF5_DIR=$(dpkg -L libhdf5-openmpi-dev | grep libhdf5.so | xargs dirname) + elif [[ "${{ matrix.os }}" == "macos-14" ]]; then + HDF5_DIR=$(brew list hdf5-mpi | grep "libhdf5.dylib" | xargs dirname | xargs dirname) + fi + echo $HDF5_DIR + echo "HDF5_DIR=$HDF5_DIR" >> $GITHUB_ENV + + - name: Cache PETSc + uses: actions/cache@v4 + id: cache-petsc + env: + cache-name: cache-PETSc + with: + path: "./petsc" + key: petsc-${{ matrix.os }}-${{ matrix.python-version }} + + - if: steps.cache-petsc.outputs.cache-hit != 'true' + name: Download a specific release of PETSc + run: | + git clone --depth 1 --branch v3.23.3 https://gitlab.com/petsc/petsc.git + + - if: steps.cache-petsc.outputs.cache-hit != 'true' + name: Install PETSc with complex support + working-directory: ./petsc + run: | + export PETSC_DIR=$(pwd) + export PETSC_ARCH=petsc-cmplx + ./configure --with-scalar-type=complex --with-fortran-bindings=0 --have-numpy=1 --download-fblaslapack=1 + make all + echo "PETSC_DIR=$PETSC_DIR" > petsc.env + echo "PETSC_ARCH=$PETSC_ARCH" >> petsc.env + + # This step is not really necessary and could be combined with PETSc install + # step; however it's good to verify if the cached PETSc installation really works! + - name: Test PETSc installation + working-directory: ./petsc + run: | + source petsc.env + make check + echo "PETSC_DIR=$PETSC_DIR" >> $GITHUB_ENV + echo "PETSC_ARCH=$PETSC_ARCH" >> $GITHUB_ENV + + - name: Install petsc4py + working-directory: ./petsc + run: | + python -m pip install wheel Cython numpy + python -m pip install src/binding/petsc4py + + # - name: Check parallel h5py installation + # run: | + # python -c " + # from mpi4py import MPI + # import h5py + # # This particular instantiation of h5py.File will fail if parallel h5py isn't installed + # f = h5py.File('parallel_test.hdf5', 'w', driver='mpio', comm=MPI.COMM_WORLD) + # print(f)" \ No newline at end of file diff --git a/.github/workflows/compile-with-pyccel-devel.yml b/.github/workflows/compile-with-pyccel-devel.yml index 958badbf0..0d92de584 100644 --- a/.github/workflows/compile-with-pyccel-devel.yml +++ b/.github/workflows/compile-with-pyccel-devel.yml @@ -1,3 +1,5 @@ +name: Compile psydac w. pyccel devel + on: push: branches: [ devel-tiny, devel, main ] @@ -28,129 +30,8 @@ jobs: name: Compile psydac w. pyccel devel on ${{ matrix.os }} / Python ${{ matrix.python-version }} / ${{ matrix.compile_language }} steps: - - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - cache: 'pip' - cache-dependency-path: | - pyproject.toml - requirements.txt - - - name: Install non-Python dependencies on Ubuntu - if: matrix.os == 'ubuntu-latest' - uses: awalsh128/cache-apt-pkgs-action@latest - with: - packages: gfortran openmpi-bin libopenmpi-dev libhdf5-openmpi-dev - version: 1.0 - execute_install_scripts: true - - # When loading cached apt packages, the default MPI compiler isn't set. - # Workaround is to 'reinstall' openmpi-bin, which doesn't actually perform - # installation (since openmpi-bin already exists), but instead reruns - # `update-alternatives` which fixes the symlinks to mpicc/mpif90. - - name: Reconfigure non-Python dependencies on Ubuntu - if: matrix.os == 'ubuntu-latest' - run: | - sudo apt-get update - sudo apt-get install --reinstall openmpi-bin libhdf5-openmpi-dev liblapack-dev libblas-dev - - - name: Install non-Python dependencies on macOS - if: matrix.os == 'macos-14' - run: | - brew install make - brew install open-mpi - brew install hdf5-mpi - brew install libomp - brew update - brew install python3 - brew install gcc - brew install openblas - brew install lapack - brew install git - brew install pandoc - GFORTRAN_HOME=$(which gfortran || true) - echo "GFORTRAN_HOME : $GFORTRAN_HOME" - if [[ ! -f "$GFORTRAN_HOME" ]]; then - gfort=$(find ${PATH//:/\/ } -name 'gfortran-*' -exec basename {} \; | sort | tail -n 1 || true) - echo "Found $gfort" - gfort_path=$(which ${gfort}) - folder=$(dirname ${gfort_path}) - ln -s ${gfort_path} ${folder}/gfortran - fi - echo "MPI_OPTS=--oversubscribe" >> $GITHUB_ENV - echo "/opt/homebrew/opt/make/libexec/gnubin" >> $GITHUB_PATH - - - name: Print information on MPI and HDF5 libraries - run: | - ompi_info - h5pcc -showconfig -echo || true - - - name: Upgrade pip - run: | - python -m pip install --upgrade pip - - - name: Determine directory of parallel HDF5 library - run: | - if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then - HDF5_DIR=$(dpkg -L libhdf5-openmpi-dev | grep libhdf5.so | xargs dirname) - elif [[ "${{ matrix.os }}" == "macos-14" ]]; then - HDF5_DIR=$(brew list hdf5-mpi | grep "libhdf5.dylib" | xargs dirname | xargs dirname) - fi - echo $HDF5_DIR - echo "HDF5_DIR=$HDF5_DIR" >> $GITHUB_ENV - - - name: Cache PETSc - uses: actions/cache@v4 - id: cache-petsc - env: - cache-name: cache-PETSc - with: - path: "./petsc" - key: petsc-${{ matrix.os }}-${{ matrix.python-version }} - - - if: steps.cache-petsc.outputs.cache-hit != 'true' - name: Download a specific release of PETSc - run: | - git clone --depth 1 --branch v3.23.3 https://gitlab.com/petsc/petsc.git - - - if: steps.cache-petsc.outputs.cache-hit != 'true' - name: Install PETSc with complex support - working-directory: ./petsc - run: | - export PETSC_DIR=$(pwd) - export PETSC_ARCH=petsc-cmplx - ./configure --with-scalar-type=complex --with-fortran-bindings=0 --have-numpy=1 --download-fblaslapack=1 - make all - echo "PETSC_DIR=$PETSC_DIR" > petsc.env - echo "PETSC_ARCH=$PETSC_ARCH" >> petsc.env - - # This step is not really necessary and could be combined with PETSc install - # step; however it's good to verify if the cached PETSc installation really works! - - name: Test PETSc installation - working-directory: ./petsc - run: | - source petsc.env - make check - echo "PETSC_DIR=$PETSC_DIR" >> $GITHUB_ENV - echo "PETSC_ARCH=$PETSC_ARCH" >> $GITHUB_ENV - - - name: Install petsc4py - working-directory: ./petsc - run: | - python -m pip install wheel Cython numpy - python -m pip install src/binding/petsc4py - - # - name: Check parallel h5py installation - # run: | - # python -c " - # from mpi4py import MPI - # import h5py - # # This particular instantiation of h5py.File will fail if parallel h5py isn't installed - # f = h5py.File('parallel_test.hdf5', 'w', driver='mpio', comm=MPI.COMM_WORLD) - # print(f)" + - name: Install prerequisites + uses: ./.github/actions/install/psydac-req - name: Install project run: | diff --git a/.github/workflows/test-psydac.yml b/.github/workflows/test-psydac.yml index b218e92a1..4c643dd93 100644 --- a/.github/workflows/test-psydac.yml +++ b/.github/workflows/test-psydac.yml @@ -1,5 +1,4 @@ -# This workflow will install Python dependencies and run tests with a variety of Python versions -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions +name: Test psydac on: push: @@ -31,127 +30,8 @@ jobs: name: Test Psydac on ${{ matrix.os }} / Python ${{ matrix.python-version }} / ${{ matrix.compile_language }} steps: - - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - cache: 'pip' - cache-dependency-path: | - pyproject.toml - requirements.txt - - - name: Install non-Python dependencies on Ubuntu - if: matrix.os == 'ubuntu-latest' - uses: awalsh128/cache-apt-pkgs-action@latest - with: - packages: gfortran openmpi-bin libopenmpi-dev libhdf5-openmpi-dev - version: 1.0 - execute_install_scripts: true - - # When loading cached apt packages, the default MPI compiler isn't set. - # Workaround is to 'reinstall' openmpi-bin, which doesn't actually perform - # installation (since openmpi-bin already exists), but instead reruns - # `update-alternatives` which fixes the symlinks to mpicc/mpif90. - - name: Reconfigure non-Python dependencies on Ubuntu - if: matrix.os == 'ubuntu-latest' - run: | - sudo apt-get update - sudo apt-get install --reinstall openmpi-bin libhdf5-openmpi-dev liblapack-dev libblas-dev - - - name: Install non-Python dependencies on macOS - if: matrix.os == 'macos-14' - run: | - brew install open-mpi - brew install hdf5-mpi - brew install libomp - brew update - brew install python3 - brew install gcc - brew install openblas - brew install lapack - brew install git - brew install pandoc - GFORTRAN_HOME=$(which gfortran || true) - echo "GFORTRAN_HOME : $GFORTRAN_HOME" - if [[ ! -f "$GFORTRAN_HOME" ]]; then - gfort=$(find ${PATH//:/\/ } -name 'gfortran-*' -exec basename {} \; | sort | tail -n 1 || true) - echo "Found $gfort" - gfort_path=$(which ${gfort}) - folder=$(dirname ${gfort_path}) - ln -s ${gfort_path} ${folder}/gfortran - fi - echo "MPI_OPTS=--oversubscribe" >> $GITHUB_ENV - - - name: Print information on MPI and HDF5 libraries - run: | - ompi_info - h5pcc -showconfig -echo || true - - - name: Upgrade pip - run: | - python -m pip install --upgrade pip - - - name: Determine directory of parallel HDF5 library - run: | - if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then - HDF5_DIR=$(dpkg -L libhdf5-openmpi-dev | grep libhdf5.so | xargs dirname) - elif [[ "${{ matrix.os }}" == "macos-14" ]]; then - HDF5_DIR=$(brew list hdf5-mpi | grep "libhdf5.dylib" | xargs dirname | xargs dirname) - fi - echo $HDF5_DIR - echo "HDF5_DIR=$HDF5_DIR" >> $GITHUB_ENV - - - name: Cache PETSc - uses: actions/cache@v4 - id: cache-petsc - env: - cache-name: cache-PETSc - with: - path: "./petsc" - key: petsc-${{ matrix.os }}-${{ matrix.python-version }} - - - if: steps.cache-petsc.outputs.cache-hit != 'true' - name: Download a specific release of PETSc - run: | - git clone --depth 1 --branch v3.23.3 https://gitlab.com/petsc/petsc.git - - - if: steps.cache-petsc.outputs.cache-hit != 'true' - name: Install PETSc with complex support - working-directory: ./petsc - run: | - export PETSC_DIR=$(pwd) - export PETSC_ARCH=petsc-cmplx - ./configure --with-scalar-type=complex --with-fortran-bindings=0 --have-numpy=1 --download-fblaslapack=1 - make all - echo "PETSC_DIR=$PETSC_DIR" > petsc.env - echo "PETSC_ARCH=$PETSC_ARCH" >> petsc.env - - # This step is not really necessary and could be combined with PETSc install - # step; however it's good to verify if the cached PETSc installation really works! - - name: Test PETSc installation - working-directory: ./petsc - run: | - source petsc.env - make check - echo "PETSC_DIR=$PETSC_DIR" >> $GITHUB_ENV - echo "PETSC_ARCH=$PETSC_ARCH" >> $GITHUB_ENV - - - name: Install petsc4py - working-directory: ./petsc - run: | - python -m pip install wheel Cython numpy - python -m pip install src/binding/petsc4py - - # - name: Check parallel h5py installation - # run: | - # python -c " - # from mpi4py import MPI - # import h5py - # # This particular instantiation of h5py.File will fail if parallel h5py isn't installed - # f = h5py.File('parallel_test.hdf5', 'w', driver='mpio', comm=MPI.COMM_WORLD) - # print(f)" + - name: Install prerequisites + uses: ./.github/actions/install/psydac-req - name: Install project without mpi run: | diff --git a/.github/workflows/test-struphy.yml b/.github/workflows/test-struphy.yml index d5e076acd..5c6ad6155 100644 --- a/.github/workflows/test-struphy.yml +++ b/.github/workflows/test-struphy.yml @@ -28,70 +28,8 @@ jobs: name: Test Struphy on ${{ matrix.os }} / Python ${{ matrix.python-version }} / ${{ matrix.compile_language }} steps: - - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - cache: 'pip' - cache-dependency-path: | - pyproject.toml - requirements.txt - - - name: Install non-Python dependencies on Ubuntu - if: matrix.os == 'ubuntu-latest' - uses: awalsh128/cache-apt-pkgs-action@latest - with: - packages: gfortran openmpi-bin libopenmpi-dev libhdf5-openmpi-dev g++ liblapack3 cmake cmake-curses-gui zlib1g-dev libnetcdf-dev libnetcdff-dev - version: 1.0 - execute_install_scripts: true - - # When loading cached apt packages, the default MPI compiler isn't set. - # Workaround is to 'reinstall' openmpi-bin, which doesn't actually perform - # installation (since openmpi-bin already exists), but instead reruns - # `update-alternatives` which fixes the symlinks to mpicc/mpif90. - - name: Reconfigure non-Python dependencies on Ubuntu - if: matrix.os == 'ubuntu-latest' - run: | - sudo apt-get update - sudo apt-get install --reinstall openmpi-bin libhdf5-openmpi-dev liblapack-dev libblas-dev liblapack3 - - - name: Install non-Python dependencies on macOS - if: matrix.os == 'macos-14' - run: | - brew install open-mpi - brew install hdf5-mpi - brew install libomp - brew update - brew install python3 - brew install gcc - brew install openblas - brew install lapack - brew install git - brew install pandoc - brew install cmake - brew install netcdf-fortran - brew install pkgconf - GFORTRAN_HOME=$(which gfortran || true) - echo "GFORTRAN_HOME : $GFORTRAN_HOME" - if [[ ! -f "$GFORTRAN_HOME" ]]; then - gfort=$(find ${PATH//:/\/ } -name 'gfortran-*' -exec basename {} \; | sort | tail -n 1 || true) - echo "Found $gfort" - gfort_path=$(which ${gfort}) - folder=$(dirname ${gfort_path}) - ln -s ${gfort_path} ${folder}/gfortran - fi - echo "MPI_OPTS=--oversubscribe" >> $GITHUB_ENV - - - name: Print information on MPI and HDF5 libraries - run: | - ompi_info - h5pcc -showconfig -echo || true - - - name: Upgrade pip - run: | - python -m pip install --upgrade pip + - name: Install prerequisites + uses: ./.github/actions/install/psydac-req - name: Install project without mpi run: | From a1d0107b41eb8798300b8728e3bf40e48fa73499 Mon Sep 17 00:00:00 2001 From: Stefan Possanner Date: Fri, 7 Nov 2025 11:18:26 +0100 Subject: [PATCH 05/12] move actions into correct place --- .github/{workflows => }/actions/install/psydac-req/action.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/{workflows => }/actions/install/psydac-req/action.yml (100%) diff --git a/.github/workflows/actions/install/psydac-req/action.yml b/.github/actions/install/psydac-req/action.yml similarity index 100% rename from .github/workflows/actions/install/psydac-req/action.yml rename to .github/actions/install/psydac-req/action.yml From 078790bb6f29cceb36f584d54edc3af69fa92f9e Mon Sep 17 00:00:00 2001 From: Stefan Possanner Date: Fri, 7 Nov 2025 11:22:52 +0100 Subject: [PATCH 06/12] forgot to checkout repo --- .github/actions/install/psydac-req/action.yml | 3 --- .github/workflows/compile-with-pyccel-devel.yml | 3 +++ .github/workflows/test-psydac.yml | 3 +++ .github/workflows/test-struphy.yml | 3 +++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/actions/install/psydac-req/action.yml b/.github/actions/install/psydac-req/action.yml index 4b98614f2..5c67c3ae9 100644 --- a/.github/actions/install/psydac-req/action.yml +++ b/.github/actions/install/psydac-req/action.yml @@ -3,9 +3,6 @@ name: Install prerequisites runs: using: composite steps: - - name: Checkout repo - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: diff --git a/.github/workflows/compile-with-pyccel-devel.yml b/.github/workflows/compile-with-pyccel-devel.yml index 0d92de584..9a8916c67 100644 --- a/.github/workflows/compile-with-pyccel-devel.yml +++ b/.github/workflows/compile-with-pyccel-devel.yml @@ -30,6 +30,9 @@ jobs: name: Compile psydac w. pyccel devel on ${{ matrix.os }} / Python ${{ matrix.python-version }} / ${{ matrix.compile_language }} steps: + - name: Checkout repo + uses: actions/checkout@v4 + - name: Install prerequisites uses: ./.github/actions/install/psydac-req diff --git a/.github/workflows/test-psydac.yml b/.github/workflows/test-psydac.yml index 4c643dd93..4e6dc606e 100644 --- a/.github/workflows/test-psydac.yml +++ b/.github/workflows/test-psydac.yml @@ -30,6 +30,9 @@ jobs: name: Test Psydac on ${{ matrix.os }} / Python ${{ matrix.python-version }} / ${{ matrix.compile_language }} steps: + - name: Checkout repo + uses: actions/checkout@v4 + - name: Install prerequisites uses: ./.github/actions/install/psydac-req diff --git a/.github/workflows/test-struphy.yml b/.github/workflows/test-struphy.yml index 5c6ad6155..d3f69c2bf 100644 --- a/.github/workflows/test-struphy.yml +++ b/.github/workflows/test-struphy.yml @@ -28,6 +28,9 @@ jobs: name: Test Struphy on ${{ matrix.os }} / Python ${{ matrix.python-version }} / ${{ matrix.compile_language }} steps: + - name: Checkout repo + uses: actions/checkout@v4 + - name: Install prerequisites uses: ./.github/actions/install/psydac-req From 5f6387b9970a80271ad0645064975e4368e40df6 Mon Sep 17 00:00:00 2001 From: Stefan Possanner Date: Fri, 7 Nov 2025 11:24:11 +0100 Subject: [PATCH 07/12] add indent --- .github/actions/install/psydac-req/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/install/psydac-req/action.yml b/.github/actions/install/psydac-req/action.yml index 5c67c3ae9..04b7e7e06 100644 --- a/.github/actions/install/psydac-req/action.yml +++ b/.github/actions/install/psydac-req/action.yml @@ -9,8 +9,8 @@ runs: python-version: ${{ matrix.python-version }} cache: 'pip' cache-dependency-path: | - pyproject.toml - requirements.txt + pyproject.toml + requirements.txt - name: Install non-Python dependencies on Ubuntu if: matrix.os == 'ubuntu-latest' From 4bd6cdbbf26b0a5df52f6456af41a497a36f5a75 Mon Sep 17 00:00:00 2001 From: Stefan Possanner Date: Fri, 7 Nov 2025 11:27:11 +0100 Subject: [PATCH 08/12] add default run shell to action --- .github/actions/install/psydac-req/action.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/actions/install/psydac-req/action.yml b/.github/actions/install/psydac-req/action.yml index 04b7e7e06..5cacd8954 100644 --- a/.github/actions/install/psydac-req/action.yml +++ b/.github/actions/install/psydac-req/action.yml @@ -1,5 +1,9 @@ name: Install prerequisites +defaults: + run: + shell: bash + runs: using: composite steps: From a85b1d0fd019989dc14b88635c10cdd313092517 Mon Sep 17 00:00:00 2001 From: Stefan Possanner Date: Fri, 7 Nov 2025 11:31:31 +0100 Subject: [PATCH 09/12] add shell to each run in action --- .github/actions/install/psydac-req/action.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/actions/install/psydac-req/action.yml b/.github/actions/install/psydac-req/action.yml index 5cacd8954..535556663 100644 --- a/.github/actions/install/psydac-req/action.yml +++ b/.github/actions/install/psydac-req/action.yml @@ -1,9 +1,5 @@ name: Install prerequisites -defaults: - run: - shell: bash - runs: using: composite steps: @@ -30,12 +26,14 @@ runs: # `update-alternatives` which fixes the symlinks to mpicc/mpif90. - name: Reconfigure non-Python dependencies on Ubuntu if: matrix.os == 'ubuntu-latest' + shell: bash run: | sudo apt-get update sudo apt-get install --reinstall openmpi-bin libhdf5-openmpi-dev liblapack-dev libblas-dev - name: Install non-Python dependencies on macOS if: matrix.os == 'macos-14' + shell: bash run: | brew install make brew install open-mpi @@ -64,15 +62,18 @@ runs: echo "/opt/homebrew/opt/make/libexec/gnubin" >> $GITHUB_PATH - name: Print information on MPI and HDF5 libraries + shell: bash run: | ompi_info h5pcc -showconfig -echo || true - name: Upgrade pip + shell: bash run: | python -m pip install --upgrade pip - name: Determine directory of parallel HDF5 library + shell: bash run: | if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then HDF5_DIR=$(dpkg -L libhdf5-openmpi-dev | grep libhdf5.so | xargs dirname) @@ -93,12 +94,14 @@ runs: - if: steps.cache-petsc.outputs.cache-hit != 'true' name: Download a specific release of PETSc + shell: bash run: | git clone --depth 1 --branch v3.23.3 https://gitlab.com/petsc/petsc.git - if: steps.cache-petsc.outputs.cache-hit != 'true' name: Install PETSc with complex support working-directory: ./petsc + shell: bash run: | export PETSC_DIR=$(pwd) export PETSC_ARCH=petsc-cmplx @@ -111,6 +114,7 @@ runs: # step; however it's good to verify if the cached PETSc installation really works! - name: Test PETSc installation working-directory: ./petsc + shell: bash run: | source petsc.env make check @@ -119,6 +123,7 @@ runs: - name: Install petsc4py working-directory: ./petsc + shell: bash run: | python -m pip install wheel Cython numpy python -m pip install src/binding/petsc4py From efc3e46221d53018ac8b00dda8965c02f4a5149b Mon Sep 17 00:00:00 2001 From: Stefan Possanner Date: Fri, 7 Nov 2025 11:49:19 +0100 Subject: [PATCH 10/12] add concurrency settings to tests --- .github/workflows/compile-with-pyccel-devel.yml | 4 ++++ .github/workflows/test-psydac.yml | 4 ++++ .github/workflows/test-struphy.yml | 6 ++++++ 3 files changed, 14 insertions(+) diff --git a/.github/workflows/compile-with-pyccel-devel.yml b/.github/workflows/compile-with-pyccel-devel.yml index 9a8916c67..7ef4b99b9 100644 --- a/.github/workflows/compile-with-pyccel-devel.yml +++ b/.github/workflows/compile-with-pyccel-devel.yml @@ -6,6 +6,10 @@ on: pull_request: branches: [ devel-tiny, devel, main ] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: compile-with-pyccel-devel: runs-on: ${{ matrix.os }} diff --git a/.github/workflows/test-psydac.yml b/.github/workflows/test-psydac.yml index 4e6dc606e..14c7be0cf 100644 --- a/.github/workflows/test-psydac.yml +++ b/.github/workflows/test-psydac.yml @@ -6,6 +6,10 @@ on: pull_request: branches: [ devel-tiny, devel, main ] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: test_psydac: runs-on: ${{ matrix.os }} diff --git a/.github/workflows/test-struphy.yml b/.github/workflows/test-struphy.yml index d3f69c2bf..fd2b9196a 100644 --- a/.github/workflows/test-struphy.yml +++ b/.github/workflows/test-struphy.yml @@ -1,9 +1,15 @@ +name: Test struphy + on: push: branches: [ devel-tiny, devel, main ] pull_request: branches: [ devel-tiny, devel, main ] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: test_struphy: runs-on: ${{ matrix.os }} From 71f38ecd00ecce2a0638f189bd67fbfd6b5d2242 Mon Sep 17 00:00:00 2001 From: Stefan Possanner Date: Fri, 7 Nov 2025 11:51:51 +0100 Subject: [PATCH 11/12] run tests only on pull-request into devel-tiny --- .github/workflows/compile-with-pyccel-devel.yml | 4 +--- .github/workflows/test-psydac.yml | 4 +--- .github/workflows/test-struphy.yml | 4 +--- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/.github/workflows/compile-with-pyccel-devel.yml b/.github/workflows/compile-with-pyccel-devel.yml index 7ef4b99b9..e3f0f2d6c 100644 --- a/.github/workflows/compile-with-pyccel-devel.yml +++ b/.github/workflows/compile-with-pyccel-devel.yml @@ -1,10 +1,8 @@ name: Compile psydac w. pyccel devel on: - push: - branches: [ devel-tiny, devel, main ] pull_request: - branches: [ devel-tiny, devel, main ] + branches: [devel-tiny] concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/.github/workflows/test-psydac.yml b/.github/workflows/test-psydac.yml index 14c7be0cf..a47ef2ea6 100644 --- a/.github/workflows/test-psydac.yml +++ b/.github/workflows/test-psydac.yml @@ -1,10 +1,8 @@ name: Test psydac on: - push: - branches: [ devel-tiny, devel, main ] pull_request: - branches: [ devel-tiny, devel, main ] + branches: [devel-tiny] concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/.github/workflows/test-struphy.yml b/.github/workflows/test-struphy.yml index fd2b9196a..294235cd8 100644 --- a/.github/workflows/test-struphy.yml +++ b/.github/workflows/test-struphy.yml @@ -1,10 +1,8 @@ name: Test struphy on: - push: - branches: [ devel-tiny, devel, main ] pull_request: - branches: [ devel-tiny, devel, main ] + branches: [devel-tiny] concurrency: group: ${{ github.workflow }}-${{ github.ref }} From c9086e14b29f3574b59cb3d6b5e044e611f8e56a Mon Sep 17 00:00:00 2001 From: Stefan Possanner Date: Fri, 7 Nov 2025 11:57:42 +0100 Subject: [PATCH 12/12] install Struphy from Github in test --- .github/workflows/test-struphy.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-struphy.yml b/.github/workflows/test-struphy.yml index 294235cd8..807fd0220 100644 --- a/.github/workflows/test-struphy.yml +++ b/.github/workflows/test-struphy.yml @@ -48,9 +48,9 @@ jobs: echo "PSYDAC_DIR=$GITHUB_WORKSPACE" >> $GITHUB_ENV echo "STRUPHY_DIR=$GITHUB_WORKSPACE/struphy" >> $GITHUB_ENV - - name: Clone struphy from GitLab + - name: Clone struphy from Github run: | - git clone https://gitlab.mpcdf.mpg.de/struphy/struphy.git $STRUPHY_DIR + git clone https://github.com/struphy-hub/struphy.git $STRUPHY_DIR - name: Install struphy without mpi #TODO: Set branch to devel working-directory: ${{ env.STRUPHY_DIR }} @@ -87,7 +87,7 @@ jobs: - name: Run struphy model tests working-directory: ${{ env.STRUPHY_DIR }} run: | - struphy test models --fast + struphy test models - name: Install mpi4py working-directory: ${{ env.STRUPHY_DIR }}