From a18c8de6ee1da0aa49ad7d4e9f18722e938486a0 Mon Sep 17 00:00:00 2001 From: Nick Atkins Date: Thu, 1 Sep 2022 14:15:42 -0500 Subject: [PATCH 1/2] Add Github Action Initial Action for Matrix Build --- .github/workflows/cmake.yml | 50 +++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/cmake.yml diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml new file mode 100644 index 00000000..ca4ec201 --- /dev/null +++ b/.github/workflows/cmake.yml @@ -0,0 +1,50 @@ +name: CMake + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + workflow_dispatch: + +env: + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) + BUILD_TYPE: Release + +jobs: + build: + strategy: + matrix: + os: [macos-latest, windows-latest, ubuntu-latest] + redis: [4, 5, 6] + include: + - os: macos-latest + gcc: 4.8 + runs-on: ${{ matrix.os }} + + + steps: + - uses: actions/checkout@v3 + + - if: ${{ matrix.gcc }} + run: export CXX="g++-${{ matrix.gcc }}" CC="gcc-${{ matrix.gcc }}" + + - name: Configure CMake + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type + run: cmake -B ${{github.workspace}}/build -DBUILD_TESTS=true -DBUILD_EXAMPLES=true -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + + - name: Build + # Build your program with the given configuration + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + + - name: Start Redis + uses: supercharge/redis-github-action@1.4.0 + with: + redis-version: ${{ matrix.redis }} + + - name: Test + working-directory: ${{github.workspace}}/build + # Execute tests defined by the CMake configuration. + run: GTEST_COLOR=1 ctest -VV -C ${{env.BUILD_TYPE}} + From a833e3b6cad9b812f03e857ea179a3fea71cddb4 Mon Sep 17 00:00:00 2001 From: Nick Atkins Date: Thu, 1 Sep 2022 14:21:13 -0500 Subject: [PATCH 2/2] Checkout Submodule --- .github/workflows/cmake.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index ca4ec201..c155094e 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -25,6 +25,8 @@ jobs: steps: - uses: actions/checkout@v3 + with: + submodules: true - if: ${{ matrix.gcc }} run: export CXX="g++-${{ matrix.gcc }}" CC="gcc-${{ matrix.gcc }}"