cmake.yml 4.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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 and Pybind11
  20. # run: sudo apt install python3-numpy python3-all-dev python-numpy-dev python3-pybind11 python3-distutils && sudo pip3 install tox
  21. run: sudo apt install python3-numpy python3-all-dev python3-pybind11 python3-distutils && sudo pip3 install tox
  22. - name: Python initial test
  23. working-directory: ${{github.workspace}}
  24. run: tox run
  25. - name: Configure CMake
  26. # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
  27. # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
  28. run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
  29. - name: Build
  30. # Build your program with the given configuration
  31. run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
  32. - name: Test
  33. working-directory: ${{github.workspace}}/build
  34. # Execute tests defined by the CMake configuration.
  35. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
  36. run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure
  37. ##################################################################
  38. # Do just the same but now with Google Test lib for C++ part
  39. ##################################################################
  40. - name: install Google Test
  41. run: sudo apt install libgtest-dev
  42. - name: Configure CMake
  43. # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
  44. # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
  45. run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
  46. - name: Build
  47. # Build your program with the given configuration
  48. run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
  49. - name: Test
  50. working-directory: ${{github.workspace}}/build
  51. # Execute tests defined by the CMake configuration.
  52. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
  53. run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure
  54. ##################################################################
  55. # Do just the same but now with Boost multiprecision
  56. ##################################################################
  57. - name: install Boost (to use multiprecision)
  58. run: sudo apt install libboost-all-dev
  59. - name: Configure CMake
  60. # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
  61. # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
  62. run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
  63. - name: Build
  64. # Build your program with the given configuration
  65. run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
  66. - name: Test
  67. working-directory: ${{github.workspace}}/build
  68. # Execute tests defined by the CMake configuration.
  69. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
  70. run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure
  71. - name: Python mp test
  72. working-directory: ${{github.workspace}}
  73. run: tox run