Skip to content

Commit

Permalink
ci: Add CMake to Open Source GitHub Actions
Browse files Browse the repository at this point in the history
Linux-CMake-Min:
Test against 3.13 to prevent breaking backcompat.

Linux-CMake:
Tests a large matrix of combinations.

Notably testing against newest version of CMake available,
and testing single/multi configuration generator.
  • Loading branch information
juan-lunarg committed Jun 22, 2023
1 parent 6ab2631 commit 90a1aaa
Showing 1 changed file with 57 additions and 3 deletions.
60 changes: 57 additions & 3 deletions .github/workflows/gtest-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ on:

env:
BAZEL_CXXOPTS: -std=c++14
CTEST_OUTPUT_ON_FAILURE: 1

permissions:
contents: read

jobs:
Linux:
Linux-Bazel:
runs-on: ubuntu-latest
steps:

Expand All @@ -22,7 +23,7 @@ jobs:
- name: Tests
run: bazel test --cxxopt=-std=c++14 --features=external_include_paths --test_output=errors ...

macOS:
macOS-Bazel:
runs-on: macos-latest
steps:

Expand All @@ -34,7 +35,7 @@ jobs:
run: bazel test --cxxopt=-std=c++14 --features=external_include_paths --test_output=errors ...


Windows:
Windows-Bazel:
runs-on: windows-latest
steps:

Expand All @@ -44,3 +45,56 @@ jobs:

- name: Tests
run: bazel test --cxxopt=/std:c++14 --features=external_include_paths --test_output=errors ...

Linux-CMake-Min:
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: lukka/get-cmake@latest
with:
cmakeVersion: 3.13.0

- name: Configure
run: cmake -S. -B build -DCMAKE_BUILD_TYPE=Release
- name: Build
run: cmake --build build

Linux-CMake:
runs-on: ubuntu-latest
strategy:
matrix:
config: [Debug, Release]
generator: ["Unix Makefiles", "Ninja Multi-Config"]
cpp_std: [14, 17, 20]
tests: ["ON", "OFF"]
cmake_off_on: ["ON", "OFF"]

steps:

- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: lukka/get-cmake@latest

- name: Configure
run: cmake -S. -B build \
-D CMAKE_BUILD_TYPE=${{ matrix.config }} \
-D CMAKE_CXX_STANDARD=${{ matrix.cpp_std }} \
-D gtest_build_samples=${{ matrix.tests }} \
-D gtest_build_tests=${{ matrix.tests }} \
-D gmock_build_tests=${{ matrix.tests }} \
-D cxx_no_exception=${{ matrix.cmake_off_on }} \
-D cxx_no_rtti=${{ matrix.cmake_off_on }}
-G "Ninja"
- name: Build
run: cmake --build build --config ${{ matrix.config }}
- name: Test
working-directory: ./build
run: ctest -C ${{ matrix.config }}
- name: Install
run: cmake --install build --prefix build/install

0 comments on commit 90a1aaa

Please sign in to comment.