From 7b0a0b374d2c7b9d614887ea1cc144afaec00eeb Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Mon, 29 Sep 2025 11:21:38 +0200 Subject: [PATCH] Test Boost configure with different CMake versions Add a configure-only test with different CMake versions. Use especially those that are tested for in CMake files. --- .github/workflows/ci.yml | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e0c69bc..f635bf7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -386,6 +386,7 @@ jobs: strategy: matrix: enable_test: [ON, OFF] + cmake_version: [default, 3.5.0, 3.6.0, 3.8.0, 3.10.0, 3.13.0, 3.14.0, 3.16.0, 3.19.0, 3.31.0, 4.0.0, 4.1.0] fail-fast: false runs-on: ubuntu-latest @@ -406,10 +407,11 @@ jobs: rm -rf tools/cmake/* cp -r $GITHUB_WORKSPACE/* tools/cmake - name: Configure each library independently + working-directory: ../boost-root + if: matrix.cmake_version == 'default' run: | failed_libs="" failed_outputs=() - cd ../boost-root for cml in libs/*/CMakeLists.txt; do lib=$(dirname "${cml#*libs/}") echo "=====================================================================" @@ -436,6 +438,33 @@ jobs: exit 1 fi + - name: Cache CMake + if: matrix.cmake_version != 'default' + id: cache-cmake + uses: actions/cache@v4 + with: + path: /tmp/cmake + key: ${{ runner.os }}-cmake-${{matrix.cmake_version}} + + - name: Build CMake + if: matrix.cmake_version != 'default' && steps.cache-cmake.outputs.cache-hit != 'true' + run: | + version=${{matrix.cmake_version}} + filename="cmake-$version.tar.gz" + cd "$(mktemp -d)" + wget https://cmake.org/files/v${version%.*}/$filename + tar -xf $filename --strip-components=1 + cmake -B __build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/tmp/cmake . + cmake --build __build -- -j 3 + cmake --build __build --target install + + - name: Configure Boost with CMake ${{matrix.cmake_version}} + working-directory: ../boost-root + if: matrix.cmake_version != 'default' + run: | + /tmp/cmake/bin/cmake --version + /tmp/cmake/bin/cmake -DBUILD_TESTING=${{matrix.enable_test}} -B "__build_cmake-$version" . + BoostTest: strategy: fail-fast: false