cmake.yml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. # without GTest and Boost
  19. - name: Install Python NumPy
  20. run: sudo apt install python-numpy python-all-dev python-numpy-dev python3-pybind11
  21. - name: Configure CMake
  22. # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
  23. # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
  24. run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
  25. - name: Build
  26. # Build your program with the given configuration
  27. run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
  28. - name: Test
  29. working-directory: ${{github.workspace}}/build
  30. # Execute tests defined by the CMake configuration.
  31. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
  32. run: ctest -C ${{env.BUILD_TYPE}}