diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml index 32018589..c9ea7ab2 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 additional dependencies to use MUMPS 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