From 8322efebc69fab0c1835f55dea78a98235037859 Mon Sep 17 00:00:00 2001 From: Gabriel Gerlero Date: Sat, 19 Oct 2024 19:13:51 -0300 Subject: [PATCH] Fix multiple installs --- .github/workflows/ci.yml | 38 +++++++++++++++++++++++++++++--------- action.yml | 9 +++++++-- 2 files changed, 36 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 501f390..510aa03 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -141,17 +141,17 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Set up OpenFOAM + - name: Set up OpenFOAM ${{ matrix.openfoam-version }} uses: ./ with: openfoam-version: ${{ matrix.openfoam-version }} - - name: Run icoFoam -help - run: icoFoam -help + - name: Test icoFoam -help + run: icoFoam -help | grep OpenFOAM-${{ matrix.openfoam-version }} - name: Test shell session if: matrix.openfoam-version >= 1000 run: | - openfoam -help - openfoam${{ matrix.openfoam-version }} -help + openfoam -help | grep OpenFOAM-${{ matrix.openfoam-version }} + openfoam${{ matrix.openfoam-version }} -help | grep OpenFOAM-${{ matrix.openfoam-version }} - name: Regression test run: source $WM_DIR/scripts/AllwmakeParseArguments @@ -243,12 +243,32 @@ jobs: uses: ./ with: openfoam-version: ${{ matrix.openfoam-version }} - - name: Run icoFoam -help - run: icoFoam -help + - name: Test icoFoam -help + run: icoFoam -help | grep OpenFOAM-${{ matrix.openfoam-version }} - name: Test shell session if: matrix.openfoam-version >= 1000 run: | - openfoam -help - openfoam${{ matrix.openfoam-version }} -help + openfoam -help | grep OpenFOAM-${{ matrix.openfoam-version }} + openfoam${{ matrix.openfoam-version }} -help | grep OpenFOAM-${{ matrix.openfoam-version }} - name: Regression test run: . $WM_DIR/scripts/AllwmakeParseArguments + + multiple-installs: + runs-on: ubuntu-24.04 + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set up OpenFOAM 2406 + uses: ./ + with: + openfoam-version: 2406 + - name: Set up OpenFOAM 2312 + uses: ./ + with: + openfoam-version: 2312 + - name: Test OpenFOAM 2312 + run: | + icoFoam -help | grep OpenFOAM-2312 + openfoam icoFoam -help | grep OpenFOAM-2312 + - name: Test OpenFOAM v2406 + run: openfoam2406 icoFoam -help | grep OpenFOAM-2406 diff --git a/action.yml b/action.yml index 50fbd38..de6d167 100644 --- a/action.yml +++ b/action.yml @@ -93,7 +93,12 @@ runs: if: inputs.openfoam-version >= 1000 run: | mkdir -p ~/.setup-openfoam/bin - ln -s "${{ steps.prep.outputs.openfoam-etc }}/openfoam" ~/.setup-openfoam/bin/openfoam${{ inputs.openfoam-version }} - ln -s "${{ steps.prep.outputs.openfoam-etc }}/openfoam" ~/.setup-openfoam/bin/openfoam + + echo '#!/bin/bash' > ~/.setup-openfoam/bin/openfoam${{ inputs.openfoam-version }} + echo 'exec "${{ steps.prep.outputs.openfoam-etc }}/openfoam" "$@"' >> ~/.setup-openfoam/bin/openfoam${{ inputs.openfoam-version }} + chmod +x ~/.setup-openfoam/bin/openfoam${{ inputs.openfoam-version }} + + ln -sf ~/.setup-openfoam/bin/openfoam${{ inputs.openfoam-version }} ~/.setup-openfoam/bin/openfoam + echo ~/.setup-openfoam/bin >> "$GITHUB_PATH" shell: bash