From 80d9cf2f94bbb80624ce7526b1abfc1e4a97f5a7 Mon Sep 17 00:00:00 2001 From: Vladimir Semyonov Date: Wed, 13 Sep 2023 11:38:54 +0400 Subject: [PATCH] GitHub Actions: set up CMake --- .github/workflows/cmake.yml | 40 +++++++++++++++++++++++++++++++++++++ 1 file changed, 40 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 0000000..a9f3469 --- /dev/null +++ b/.github/workflows/cmake.yml @@ -0,0 +1,40 @@ +name: CMake + +on: + workflow_dispatch: + pull_request: + push: + branches: [main] + +jobs: + build-and-test: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [windows-2022, ubuntu-22.04] + build-type: [Debug, Release] + steps: + - run: git config --global core.autocrlf false + + - uses: actions/checkout@v4.0.0 + + - name: Build and Test + shell: bash + run: | + # ... + + GENERATOR_FLAG="" + if [ "$RUNNER_OS" == "Windows" ]; then + GENERATOR_FLAG="-GNinja" + fi + + cmake \ + -S svf_tools \ + -B .build \ + ${GENERATOR_FLAG} \ + -DCMAKE_C_COMPILER=clang \ + -DCMAKE_CXX_COMPILER=clang++ \ + -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} + + cmake --build .build + ctest --test-dir .build