cmake.yml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. name: CMake
  2. on:
  3. push:
  4. branches: [ "master" ]
  5. pull_request:
  6. branches: [ "master" ]
  7. env:
  8. # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
  9. BUILD_TYPE: Release
  10. jobs:
  11. build:
  12. # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
  13. # You can convert this to a matrix build if you need cross-platform coverage.
  14. # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
  15. runs-on: ubuntu-latest
  16. steps:
  17. - uses: actions/checkout@v3
  18. - name: Configure CMake
  19. # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
  20. # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
  21. run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
  22. - name: Build
  23. # Build your program with the given configuration
  24. run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
  25. - name: Test
  26. working-directory: ${{github.workspace}}/build
  27. # Execute tests defined by the CMake configuration.
  28. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
  29. run: ctest -C ${{env.BUILD_TYPE}}