6767
6868 steps :
6969 - name : Checkout Repository
70- uses : actions/checkout@v3
70+ uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
7171
7272 - name : Set Up Directories & Environment
7373 run : |
@@ -227,16 +227,31 @@ jobs:
227227 shell : bash
228228
229229 - name : Install CMake
230- if : runner.os == 'Linux' && inputs.cmake != ''
231230 # CMakeLists.txt specifies a minimum CMake version of 3.14 for
232- # the Imath project, so use that for the CI. Except that the
233- # conan toolchain requires a minimum of 3.15, so use that for
234- # the runs that require conan.
231+ # the Imath project, so use that for the CI, unless a specific
232+ # version is specified. The conan toolchain requires a minimum
233+ # of 3.15, so use that for the runs that require conan.
235234 run : |
236- CMAKE_VERSION=${{ inputs.cmake }}
237- wget https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION-Linux-x86_64.tar.gz
238- tar -xzf cmake-$CMAKE_VERSION-Linux-x86_64.tar.gz
239- echo "CMAKE=$PWD/cmake-$CMAKE_VERSION-Linux-x86_64/bin/cmake" >> $GITHUB_ENV
235+ set -ex
236+ CMAKE=cmake
237+ CTEST=ctest
238+ if [ "${{ inputs.cmake }}" != "" ]; then
239+ if [ "$RUNNER_OS" == "Linux" ]; then
240+ CMAKE_VERSION=${{ inputs.cmake }}
241+ CURRENT_CMAKE_VERSION=$(cmake --version | head -n 1 | cut -f3 -d' ')
242+ if [ "$CMAKE_VERSION" != "$CURRENT_CMAKE_VERSION" ]; then
243+ wget https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION-Linux-x86_64.tar.gz
244+ tar -xzf cmake-$CMAKE_VERSION-Linux-x86_64.tar.gz
245+ CMAKE=$(find "$PWD" -type f -path "*/bin/cmake" | head -n 1)
246+ CTEST=$(find "$PWD" -type f -path "*/bin/ctest" | head -n 1)
247+ fi
248+ else
249+ echo "Explicit cmake version only supported on Linux."
250+ exit 1
251+ fi
252+ fi
253+ echo CMAKE="$CMAKE" >> $GITHUB_ENV
254+ echo CTEST="$CTEST" >> $GITHUB_ENV
240255 shell : bash
241256
242257 - name : Construct CMake command
@@ -426,7 +441,7 @@ jobs:
426441 set -x
427442 export PATH="$IMATH_PATH:$PATH"
428443 export PYTHONPATH=$PYTHON_INSTALL_DIR
429- ctest -T Test -C ${{ inputs.build-type }} --test-dir $BUILD_DIR --timeout 7200 --output-on-failure -VV
444+ $CTEST -T Test -C ${{ inputs.build-type }} --test-dir $BUILD_DIR --timeout 7200 --output-on-failure -VV
430445 shell : bash
431446
432447 - name : Test (msys2)
@@ -436,7 +451,7 @@ jobs:
436451 set -x
437452 export PATH="$IMATH_PATH:$PATH"
438453 export PYTHONPATH=$PYTHON_INSTALL_DIR
439- ctest -T Test -C ${{ inputs.build-type }} --test-dir $BUILD_DIR --timeout 7200 --output-on-failure -VV
454+ $CTEST -T Test -C ${{ inputs.build-type }} --test-dir $BUILD_DIR --timeout 7200 --output-on-failure -VV
440455 shell : msys2 {0}
441456
442457 - name : Prepare install_manifest
0 commit comments