Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding CMake 3.4 check #394

Merged
merged 5 commits into from
Jan 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ci/azure-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ steps:

- task: CMake@1
inputs:
cmakeArgs: .. -DCLI11_WARNINGS_AS_ERRORS=ON -DCLI11_SINGLE_FILE=$(cli11.single) -DCLI11_CXX_STD=$(cli11.std) -DCLI11_SINGLE_FILE_TESTS=$(cli11.single) -DCMAKE_BUILD_TYPE=$(cli11.build_type) $(cli11.options)
cmakeArgs: .. -DCLI11_WARNINGS_AS_ERRORS=ON -DCLI11_SINGLE_FILE=$(cli11.single) -DCMAKE_CXX_STANDARD=$(cli11.std) -DCLI11_SINGLE_FILE_TESTS=$(cli11.single) -DCMAKE_BUILD_TYPE=$(cli11.build_type) $(cli11.options)
displayName: 'Configure'

- script: cmake --build .
Expand Down
2 changes: 1 addition & 1 deletion .ci/make_and_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set -evx

mkdir -p build
cd build
cmake .. -DCLI11_WARNINGS_AS_ERRORS=ON -DCLI11_SINGLE_FILE=ON -DCLI11_CXX_STD=$STD -DCLI11_SINGLE_FILE_TESTS=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER_LAUNCHER=ccache $@
cmake .. -DCLI11_WARNINGS_AS_ERRORS=ON -DCLI11_SINGLE_FILE=ON -DCMAKE_CXX_STANDARD=$STD -DCLI11_SINGLE_FILE_TESTS=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER_LAUNCHER=ccache $@
cmake --build . -- -j2

set +evx
Expand Down
16 changes: 16 additions & 0 deletions .github/actions/cmake_config/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
16 changes: 16 additions & 0 deletions .github/actions/cmake_config/action.yml
Original file line number Diff line number Diff line change
@@ -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 }}
23 changes: 23 additions & 0 deletions .github/actions/cmake_config/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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
96 changes: 85 additions & 11 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,88 @@ jobs:
runs-on: ubuntu-latest
container: nvidia/cuda:10.2-devel-ubuntu18.04
steps:
- uses: actions/checkout@v1
with:
submodules: true
- name: Add wget
run: apt-get update && apt-get install -y wget
- name: Install Modern CMake
run: wget -qO- "https://cmake.org/files/v3.16/cmake-3.16.0-Linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C /usr/local
- name: Configure
run: cmake -S . -B build -DCLI11_CUDA_TESTS=ON
- name: Build
run: cmake --build build
- uses: actions/checkout@v1
with:
submodules: true
- name: Add wget
run: apt-get update && apt-get install -y wget
- name: Install Modern CMake
run: wget -qO- "https://cmake.org/files/v3.16/cmake-3.16.0-Linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C /usr/local
- name: Configure
run: cmake -S . -B build -DCLI11_CUDA_TESTS=ON
- name: Build
run: cmake --build build -j2

cmake-config:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how long does this take to run on all versions of cmake?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

About 6 seconds each. Plus a little for the initial docker build, total is under 2 minutes.

Screen Shot 2020-01-08 at 8 31 29 PM

name: CMake config check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
submodules: true
- 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()
6 changes: 0 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
[submodule "extern/googletest"]
path = extern/googletest
url = ../../google/googletest.git
[submodule "extern/sanitizers"]
path = extern/sanitizers
url = ../../arsenm/sanitizers-cmake
[submodule "extern/json"]
path = extern/json
url = ../../nlohmann/json.git
Loading