From 8a0889ed44f437e830a032d3801972f866073bba Mon Sep 17 00:00:00 2001 From: scivision Date: Thu, 1 Aug 2024 08:46:04 -0400 Subject: [PATCH] CMake >= 3.20 required & CI enabled --- .github/workflows/ci.yml | 33 ++++++++++++++++++++ .github/workflows/composite-cmake/action.yml | 26 +++++++++++++++ CMakeLists.txt | 2 +- 3 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/composite-cmake/action.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index be4fbc0..580a6e5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -125,3 +125,36 @@ jobs: with: name: coverage-report-html path: build-coverage/coverage/ + + + cmake-older: + timeout-minutes: 30 + + runs-on: ubuntu-latest + + strategy: + matrix: + cmake_version: ["3.20.6"] + + steps: + + - uses: actions/checkout@v4 + + - name: prereqs + run: | + sudo apt-get update + sudo apt install --no-install-recommends libhdf5-dev + + - uses: ./.github/workflows/composite-cmake + + - name: configure + run: $CMAKE -Bbuild -DCMAKE_INSTALL_PREFIX:PATH=$(pwd)/build/local + + - name: build + run: $CMAKE --build build + + - name: test + run: $CTEST --test-dir build + + - name: install package + run: $CMAKE --install build diff --git a/.github/workflows/composite-cmake/action.yml b/.github/workflows/composite-cmake/action.yml new file mode 100644 index 0000000..af67e35 --- /dev/null +++ b/.github/workflows/composite-cmake/action.yml @@ -0,0 +1,26 @@ +runs: + + using: "composite" + + steps: + - name: environment + shell: bash + run: | + echo "osarch=linux-x86_64" >> $GITHUB_ENV + echo "archive=linux-x86_64.tar.gz" >> $GITHUB_ENV + + - name: Install CMake ${{ matrix.cmake_version }} + shell: bash + run: | + curl -LO "https://github.com/Kitware/CMake/releases/download/v${{ matrix.cmake_version }}/cmake-${{ matrix.cmake_version }}-$archive" + tar -xf cmake-${{ matrix.cmake_version }}-$archive + + - name: CMake path + shell: bash + run: | + echo "CMAKE=$GITHUB_WORKSPACE/cmake-${{ matrix.cmake_version }}-$osarch/bin/cmake" >> $GITHUB_ENV + echo "CTEST=$GITHUB_WORKSPACE/cmake-${{ matrix.cmake_version }}-$osarch/bin/ctest" >> $GITHUB_ENV + + - name: echo CMake version + shell: bash + run: $CMAKE --version diff --git a/CMakeLists.txt b/CMakeLists.txt index cd575b2..89005c4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.19...3.30) +cmake_minimum_required(VERSION 3.20...3.30) if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) message(FATAL_ERROR "Please do out of source build like