From 45eefe9bf3c26d3b6fd48c36ab717b98188d2155 Mon Sep 17 00:00:00 2001 From: KienTTran <86167342+KienTTran@users.noreply.github.com> Date: Mon, 14 Oct 2024 20:04:27 -0400 Subject: [PATCH] Create cmake-single-platform.yml --- .github/workflows/cmake-single-platform.yml | 78 +++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 .github/workflows/cmake-single-platform.yml diff --git a/.github/workflows/cmake-single-platform.yml b/.github/workflows/cmake-single-platform.yml new file mode 100644 index 0000000..d2a7e9c --- /dev/null +++ b/.github/workflows/cmake-single-platform.yml @@ -0,0 +1,78 @@ +name: Build and Test with CMake + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +env: + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) + BUILD_TYPE: Release + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Install dependencies via vcpkg + run: | + git clone https://github.com/microsoft/vcpkg.git + ./vcpkg/bootstrap-vcpkg.sh + ./vcpkg/vcpkg install gtest + + - name: Configure CMake + # Configure CMake with vcpkg toolchain and the build subdirectory. + run: | + cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ + -DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/vcpkg/scripts/buildsystems/vcpkg.cmake + + - name: Build + # Build your project with the given configuration + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + + - name: Test + working-directory: ${{github.workspace}}/build + # Execute tests defined by the CMake configuration. + run: ctest --output-on-failure -C ${{env.BUILD_TYPE}} +name: Build and Test with CMake + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +env: + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) + BUILD_TYPE: Release + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Install dependencies via vcpkg + run: | + git clone https://github.com/microsoft/vcpkg.git + ./vcpkg/bootstrap-vcpkg.sh + ./vcpkg/vcpkg install gtest + + - name: Configure CMake + # Configure CMake with vcpkg toolchain and the build subdirectory. + run: | + cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ + -DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/vcpkg/scripts/buildsystems/vcpkg.cmake + + - name: Build + # Build your project with the given configuration + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + + - name: Test + working-directory: ${{github.workspace}}/build + # Execute tests defined by the CMake configuration. + run: ctest --output-on-failure -C ${{env.BUILD_TYPE}}