From 9de067fdf0c7b6ee2863bbbe61bdb80f99e09aba Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Fri, 16 Aug 2019 10:21:30 -0700 Subject: [PATCH 1/6] Add a starter cmake workflow --- ci/cmake.yml | 17 + ci/properties/cmake.properties.json | 6 + icons/cmake.svg | 493 ++++++++++++++++++++++++++++ 3 files changed, 516 insertions(+) create mode 100644 ci/cmake.yml create mode 100644 ci/properties/cmake.properties.json create mode 100644 icons/cmake.svg diff --git a/ci/cmake.yml b/ci/cmake.yml new file mode 100644 index 0000000..82373a6 --- /dev/null +++ b/ci/cmake.yml @@ -0,0 +1,17 @@ +name: CMake CI + +on: [push] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: configure + run: cmake . + - name: build + run: cmake --build . + - name: test + run: ctest -C Debug diff --git a/ci/properties/cmake.properties.json b/ci/properties/cmake.properties.json new file mode 100644 index 0000000..ac001c3 --- /dev/null +++ b/ci/properties/cmake.properties.json @@ -0,0 +1,6 @@ +{ + "name": "CMake based projects", + "description": "Build and test a CMake based project.", + "iconName": "cmake", + "categories": ["C", "C++"] +} \ No newline at end of file diff --git a/icons/cmake.svg b/icons/cmake.svg new file mode 100644 index 0000000..254fe01 --- /dev/null +++ b/icons/cmake.svg @@ -0,0 +1,493 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From d01030b5b8ab0e4429575cedcd1aa39ddc68b628 Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Thu, 19 Sep 2019 14:39:49 -0700 Subject: [PATCH 2/6] Switch to out-of-source builds --- ci/cmake.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/ci/cmake.yml b/ci/cmake.yml index 82373a6..8d7ffb9 100644 --- a/ci/cmake.yml +++ b/ci/cmake.yml @@ -9,9 +9,14 @@ jobs: steps: - uses: actions/checkout@v1 - - name: configure - run: cmake . + - name: create-build-dir + run: cmake -E make_directory ${{runner.workspace}}/build + - name: cmake-configure + working-directory: ${{runner.workspace}}/build + run: cmake $GITHUB_WORKSPACE - name: build - run: cmake --build . + working-directory: ${{runner.workspace}}/build + run: cmake --build . --config Release - name: test - run: ctest -C Debug + working-directory: ${{runner.workspace}}/build + run: ctest -C Release From d78d85f6c7a2867de862846825d53dc2d00b84cd Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Fri, 18 Oct 2019 09:24:35 -0700 Subject: [PATCH 3/6] Applying naming feedback, adding comments and expanding target platforms --- ci/cmake.yml | 42 +++++++++++++++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 9 deletions(-) diff --git a/ci/cmake.yml b/ci/cmake.yml index 8d7ffb9..8ca2397 100644 --- a/ci/cmake.yml +++ b/ci/cmake.yml @@ -2,21 +2,45 @@ name: CMake CI on: [push] +env: + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) + BUILD_TYPE: Release + jobs: build: - runs-on: ubuntu-latest - + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [windows-latest, ubuntu-latest, macOS-latest] + steps: - uses: actions/checkout@v1 - - name: create-build-dir + + - name: Create Build Environment + # Some projects don't allow in-source building, so create a separate build directory + # We'll use this as our working directory for all subsequent commands run: cmake -E make_directory ${{runner.workspace}}/build - - name: cmake-configure + + - name: Configure CMake + # Use a bash shell so we can use the same syntax for environment variable + # access regardless of the host operating system + shell: bash working-directory: ${{runner.workspace}}/build - run: cmake $GITHUB_WORKSPACE - - name: build + # Note the current convention is to use the -S and -B options here to specify source + # and build directories, but this is only available with CMake 3.13 and higher. + # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 + run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE + + - name: Build working-directory: ${{runner.workspace}}/build - run: cmake --build . --config Release - - name: test + shell: bash + # Execute the build. You can specify a specific target with "--target " + run: cmake --build . --config $BUILD_TYPE + + - name: Test working-directory: ${{runner.workspace}}/build - run: ctest -C Release + shell: bash + # Execute tests defined by the CMake configuration. + # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail + run: ctest -C $BUILD_TYPE From 9342fc5f270d28c3123ef456c03071b39f6b48f7 Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Fri, 18 Oct 2019 09:27:36 -0700 Subject: [PATCH 4/6] Fix workflow name to drop 'CI' --- ci/cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/cmake.yml b/ci/cmake.yml index 8ca2397..2690d75 100644 --- a/ci/cmake.yml +++ b/ci/cmake.yml @@ -1,4 +1,4 @@ -name: CMake CI +name: CMake on: [push] From 760d91097ac9a9c24a29728c2a72bd36498b85ca Mon Sep 17 00:00:00 2001 From: Bradley Austin Davis Date: Fri, 21 Aug 2020 18:35:36 -0700 Subject: [PATCH 5/6] Update ci/cmake.yml Co-authored-by: Andy McKay --- ci/cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/cmake.yml b/ci/cmake.yml index 2690d75..b69efe7 100644 --- a/ci/cmake.yml +++ b/ci/cmake.yml @@ -15,7 +15,7 @@ jobs: os: [windows-latest, ubuntu-latest, macOS-latest] steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Create Build Environment # Some projects don't allow in-source building, so create a separate build directory From 9ca8884216a65b93dafb9982e1de685e954ca525 Mon Sep 17 00:00:00 2001 From: Bradley Austin Davis Date: Fri, 21 Aug 2020 18:39:05 -0700 Subject: [PATCH 6/6] Switching to single-platform build per PR comments --- ci/cmake.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ci/cmake.yml b/ci/cmake.yml index b69efe7..dae54ec 100644 --- a/ci/cmake.yml +++ b/ci/cmake.yml @@ -8,11 +8,11 @@ env: jobs: build: - - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [windows-latest, ubuntu-latest, macOS-latest] + # The CMake configure and build commands are platform agnostic and should work equally + # well on Windows or Mac. You can convert this to a matrix build if you need + # cross-platform coverage. + # See: https://docs.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow#configuring-a-build-matrix + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2