From ea0204d4230a3b09cae7082d758ced58cac1c4be Mon Sep 17 00:00:00 2001 From: Harish Mahendrakar Date: Tue, 19 Sep 2023 11:21:21 -0700 Subject: [PATCH] Added github actions to check cmake builds --- .github/workflows/cmake.yml | 48 +++++++++++++++++++++++++++++++++++++ 1 file changed, 48 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..a21dd587 --- /dev/null +++ b/.github/workflows/cmake.yml @@ -0,0 +1,48 @@ +name: CMake + +on: + push: + pull_request: + +env: + BUILD_TYPE: Release + +jobs: + build: + strategy: + matrix: + include: + - name: ubuntu-latest-gcc-cmake + os: ubuntu-latest + cc: gcc + cxx: g++ + build-system: cmake + + - name: ubuntu-latest-clang-cmake + os: ubuntu-latest + cc: clang + cxx: clang++ + build-system: cmake + + - name: macos-latest-clang-cmake + os: macos-latest + cc: clang + cxx: clang++ + build-system: cmake + + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v3 + + - name: Install MacOS dependencies + if: startsWith(matrix.os,'macos') + run: | + brew update + brew install llvm + + - name: Configure CMake + run: cmake -B ${{github.workspace}}/out -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ + + - name: Build + run: cmake --build ${{github.workspace}}/out --config ${{env.BUILD_TYPE}}