|
31 | 31 | required: false |
32 | 32 | type: boolean |
33 | 33 | default: true |
| 34 | + min_cmake_version: |
| 35 | + description: "Minimal required CMake version, defaults to 3.16." |
| 36 | + required: false |
| 37 | + type: string |
| 38 | + default: '3.16' |
34 | 39 | enable_cygwin: |
35 | 40 | description: "When enabled, Cygwin jobs will be added. Enabled by default." |
36 | 41 | required: false |
@@ -713,8 +718,44 @@ jobs: |
713 | 718 | - { os: ubuntu-latest, build_shared: OFF, build_type: Debug, generator: 'Unix Makefiles' } |
714 | 719 | - { os: windows-2025, build_shared: ON, build_type: Debug, generator: 'Visual Studio 17 2022' } |
715 | 720 | - { os: windows-2025, build_shared: OFF, build_type: Debug, generator: 'Visual Studio 17 2022' } |
| 721 | + - { name: "Linux CMake", cmake_version: '${{inputs.minimal_cmake_version}}', |
| 722 | + os: ubuntu-latest, build_shared: ON, build_type: Debug, generator: 'Unix Makefiles' } |
716 | 723 |
|
717 | 724 | steps: |
| 725 | + - name: Cache CMake |
| 726 | + if: matrix.cmake_version |
| 727 | + id: cache-cmake |
| 728 | + uses: actions/cache@v4 |
| 729 | + with: |
| 730 | + path: /tmp/cmake |
| 731 | + key: ${{runner.os}}-cmake-${{matrix.cmake_version}} |
| 732 | + |
| 733 | + - name: Install CMake dependencies |
| 734 | + if: matrix.cmake_version |
| 735 | + run: | |
| 736 | + sudo apt-get -o Acquire::Retries=3 -y -q --no-install-suggests --no-install-recommends install curl libcurl4-openssl-dev libarchive-dev |
| 737 | + echo /tmp/cmake/bin >> $GITHUB_PATH |
| 738 | +
|
| 739 | + - name: Build CMake |
| 740 | + if: matrix.cmake_version && steps.cache-cmake.outputs.cache-hit != 'true' |
| 741 | + run: | |
| 742 | + version=${{matrix.cmake_version}} |
| 743 | + filename="cmake-$version.tar.gz" |
| 744 | + cd "$(mktemp -d)" |
| 745 | + wget https://cmake.org/files/v${version%.*}/$filename |
| 746 | + tar -xf $filename --strip-components=1 |
| 747 | + flags=( |
| 748 | + "-DCMAKE_BUILD_TYPE=Release" |
| 749 | + "-DCMAKE_INSTALL_PREFIX=/tmp/cmake" |
| 750 | + "-B" "__build" |
| 751 | + "-Wno-dev" # Make configuring more silent |
| 752 | + "-DCMAKE_USE_SYSTEM_CURL=1" # Avoid failures caused by newer (system) OpenSSL in CMake < 3.10 |
| 753 | + "-DCMAKE_CXX_FLAGS='-include cstdint -include limits'" # Fix missing includes in CMake < 3.10 |
| 754 | + ) |
| 755 | + cmake "${flags[@]}" . |
| 756 | + cmake --build __build -- -j 3 |
| 757 | + cmake --build __build --target install |
| 758 | +
|
718 | 759 | - uses: actions/checkout@v4 |
719 | 760 |
|
720 | 761 | - name: Fetch Boost.CI |
|
0 commit comments