From 6ebf0222e7340664f7c833f00ffecccc40f7fe16 Mon Sep 17 00:00:00 2001 From: Emily Bourne Date: Tue, 21 Apr 2026 09:50:00 +0200 Subject: [PATCH 1/2] Add a dedicated action to install METIS/MUMPS caching the result --- .github/actions/build/action.yml | 26 +--------- .../actions/install-dependencies/action.yml | 49 +++++++++++++++++++ 2 files changed, 51 insertions(+), 24 deletions(-) create mode 100644 .github/actions/install-dependencies/action.yml diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml index 32018589..db209bb4 100644 --- a/.github/actions/build/action.yml +++ b/.github/actions/build/action.yml @@ -14,33 +14,11 @@ runs: run: | apt-get -qq update apt-get -qq -y install lcov - - name: Install METIS - shell: bash + - name: Install MUMPS dependencies if: inputs.use-mumps == 'true' - run: | - apt-get -qq -y install gfortran - git clone -b v5.1.0.4 https://github.com/scivision/METIS.git - cd METIS - cmake -Bbuild -DCMAKE_INSTALL_PREFIX=$(pwd)/install -DCMAKE_BUILD_TYPE=Release - cmake --build build - cmake --install build - ls install/* - echo "METIS_DIR=$(pwd)/install" >> $GITHUB_ENV - echo "METIS_ROOT=$(pwd)/install" >> $GITHUB_ENV - - name: Install MUMPS - shell: bash - if: inputs.use-mumps == 'true' - run: | - git clone -b v5.5.1.11 https://github.com/scivision/mumps.git - cd mumps - cmake -Bbuild -DBUILD_SINGLE=on -DBUILD_DOUBLE=on -Dmetis=on -Dopenmp=on -Dparallel=off -DCMAKE_INSTALL_PREFIX=$(pwd)/install -DCMAKE_BUILD_TYPE=Release -S . - cmake --build build - cmake --install build - ls install/* - echo "MUMPS_DIR=$(pwd)/install" >> $GITHUB_ENV + uses: ./.github/actions/install-dependencies - name: Build shell: bash - # ensure that the installed compiler version is used run: | mkdir build && cd build export CMAKE_PREFIX_PATH=/opt/openmp diff --git a/.github/actions/install-dependencies/action.yml b/.github/actions/install-dependencies/action.yml new file mode 100644 index 00000000..2baa7435 --- /dev/null +++ b/.github/actions/install-dependencies/action.yml @@ -0,0 +1,49 @@ +name: "Install Dependencies" +description: "Install METIS and MUMPS with caching" + +runs: + using: "composite" + steps: + - name: Install gfortran + shell: bash + run: | + apt-get -qq -y install gfortran + - name: Cache METIS + id: cache-metis + uses: actions/cache@v4 + with: + path: METIS/install + key: metis-v5.1.0.4-${{ runner.os }} + - name: Install METIS + shell: bash + if: steps.cache-metis.outputs.cache-hit != 'true' + run: | + git clone -b v5.1.0.4 https://github.com/scivision/METIS.git + cd METIS + cmake -Bbuild -DCMAKE_INSTALL_PREFIX=$(pwd)/install -DCMAKE_BUILD_TYPE=Release + cmake --build build + cmake --install build + - name: Set METIS environment variables + shell: bash + run: | + echo "METIS_DIR=$GITHUB_WORKSPACE/METIS/install" >> $GITHUB_ENV + echo "METIS_ROOT=$GITHUB_WORKSPACE/METIS/install" >> $GITHUB_ENV + - name: Cache MUMPS + id: cache-mumps + uses: actions/cache@v4 + with: + path: mumps/install + key: mumps-v5.5.1.11-metis-${{ runner.os }} + - name: Install MUMPS + shell: bash + if: steps.cache-mumps.outputs.cache-hit != 'true' + run: | + git clone -b v5.5.1.11 https://github.com/scivision/mumps.git + cd mumps + cmake -Bbuild -DBUILD_SINGLE=on -DBUILD_DOUBLE=on -Dmetis=on -Dopenmp=on -Dparallel=off -DCMAKE_INSTALL_PREFIX=$(pwd)/install -DCMAKE_BUILD_TYPE=Release -S . + cmake --build build + cmake --install build + - name: Set MUMPS environment variables + shell: bash + run: | + echo "MUMPS_DIR=$GITHUB_WORKSPACE/mumps/install" >> $GITHUB_ENV From 852f1c3e415a6124ba6aa0789fcf340d5d5c54dc Mon Sep 17 00:00:00 2001 From: Emily Bourne Date: Tue, 21 Apr 2026 11:19:32 +0200 Subject: [PATCH 2/2] More explicit --- .github/actions/build/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml index db209bb4..c9ea7ab2 100644 --- a/.github/actions/build/action.yml +++ b/.github/actions/build/action.yml @@ -14,7 +14,7 @@ runs: run: | apt-get -qq update apt-get -qq -y install lcov - - name: Install MUMPS dependencies + - name: Install additional dependencies to use MUMPS if: inputs.use-mumps == 'true' uses: ./.github/actions/install-dependencies - name: Build