From a08e25ea7b01118c34e6d8ae82490d30bc0f3c59 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Wed, 8 Jan 2020 13:02:48 -0500 Subject: [PATCH] Adding action check --- .github/actions/cmake_config/Dockerfile | 16 +++++ .github/actions/cmake_config/action.yml | 16 +++++ .github/actions/cmake_config/entrypoint.sh | 23 +++++++ .github/workflows/tests.yml | 77 +++++++++++++++++++--- 4 files changed, 123 insertions(+), 9 deletions(-) create mode 100644 .github/actions/cmake_config/Dockerfile create mode 100644 .github/actions/cmake_config/action.yml create mode 100755 .github/actions/cmake_config/entrypoint.sh diff --git a/.github/actions/cmake_config/Dockerfile b/.github/actions/cmake_config/Dockerfile new file mode 100644 index 00000000..81eb9b99 --- /dev/null +++ b/.github/actions/cmake_config/Dockerfile @@ -0,0 +1,16 @@ +FROM ubuntu:18.04 + +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + g++=4:7.4.0-1ubuntu2.3 \ + wget=1.19.4-1ubuntu2.2 \ + libidn11=1.33-2.1ubuntu1.2 \ + ca-certificates=20180409 \ + make=4.1-9.1ubuntu1 \ + git=1:2.17.1-1ubuntu0.5 \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +COPY entrypoint.sh /entrypoint.sh + +ENTRYPOINT ["/entrypoint.sh"] diff --git a/.github/actions/cmake_config/action.yml b/.github/actions/cmake_config/action.yml new file mode 100644 index 00000000..73ff1661 --- /dev/null +++ b/.github/actions/cmake_config/action.yml @@ -0,0 +1,16 @@ +description: 'Test out a bare bones configuration with a CMake version' +inputs: + version: + description: 'The full version of CMake to check' + required: true + options: + description: 'The CMake configuration options' + required: false + default: "" +name: 'Configure with CMake' +runs: + using: 'docker' + image: 'Dockerfile' + args: + - ${{ inputs.version }} + - ${{ inputs.options }} diff --git a/.github/actions/cmake_config/entrypoint.sh b/.github/actions/cmake_config/entrypoint.sh new file mode 100755 index 00000000..42e263ed --- /dev/null +++ b/.github/actions/cmake_config/entrypoint.sh @@ -0,0 +1,23 @@ +#!/bin/bash -l + +set -ex + +mkdir -p cmake_dir +mkdir -p build_tmp +mkdir -p cmake_sources +rm -rf cmake_dir/* build_tmp/* + +v=$1 +fn=cmake-$v-Linux-x86_64.tar.gz + +if [ ! -f cmake_souces/$fn ]; then + wget -qO cmake_sources/$fn "https://cmake.org/files/v${v%.*}/$fn" +fi + +tar -xzf cmake_sources/$fn --strip-components=1 -C $PWD/cmake_dir + +export PATH=$PWD/cmake_dir/bin:$PATH + +cmake --version + +cd build_tmp && cmake .. $2 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8d94fc91..c3c832bc 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -40,17 +40,76 @@ jobs: - name: Build run: cmake --build build -j2 - cmake34: - name: CMake 3.4 + cmake-config: + name: CMake config check runs-on: ubuntu-latest - # container: ubuntu:latest steps: - uses: actions/checkout@v1 with: submodules: true - - name: Add CMake folder to path - run: mkdir -p cmake && echo "::add-path::$PWD/cmake/bin" - - name: Install Modern CMake - run: wget -qO- "https://cmake.org/files/v3.4/cmake-3.4.3-Linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C $PWD/cmake - - name: Configure - run: cmake --version && mkdir -p build && cd build && cmake .. + - name: CMake 3.4 + uses: ./.github/actions/cmake_config + with: + version: 3.4.3 + - name: CMake 3.5 + uses: ./.github/actions/cmake_config + with: + version: 3.5.2 + if: success() || failure() + - name: CMake 3.6 + uses: ./.github/actions/cmake_config + with: + version: 3.6.3 + if: success() || failure() + - name: CMake 3.7 + uses: ./.github/actions/cmake_config + with: + version: 3.7.2 + if: success() || failure() + - name: CMake 3.8 + uses: ./.github/actions/cmake_config + with: + version: 3.8.2 + if: success() || failure() + - name: CMake 3.9 + uses: ./.github/actions/cmake_config + with: + version: 3.9.6 + if: success() || failure() + - name: CMake 3.10 + uses: ./.github/actions/cmake_config + with: + version: 3.10.3 + if: success() || failure() + - name: CMake 3.11 (full) + uses: ./.github/actions/cmake_config + with: + version: 3.11.4 + options: -DCLI11_SANITIZERS=ON -DCLI11_BUILD_EXAMPLES_JSON=ON + if: success() || failure() + - name: CMake 3.12 + uses: ./.github/actions/cmake_config + with: + version: 3.12.4 + if: success() || failure() + - name: CMake 3.13 + uses: ./.github/actions/cmake_config + with: + version: 3.13.5 + if: success() || failure() + - name: CMake 3.14 + uses: ./.github/actions/cmake_config + with: + version: 3.14.7 + if: success() || failure() + - name: CMake 3.15 + uses: ./.github/actions/cmake_config + with: + version: 3.15.6 + if: success() || failure() + - name: CMake 3.16 (full) + uses: ./.github/actions/cmake_config + with: + version: 3.16.2 + options: -DCLI11_SANITIZERS=ON -DCLI11_BUILD_EXAMPLES_JSON=ON + if: success() || failure()