cmake.yml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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. macos:
  12. runs-on: macOS-latest
  13. steps:
  14. - uses: actions/checkout@v3
  15. - name: Install Python NumPy and Pybind11
  16. # run: sudo apt install python3-numpy python3-all-dev python-numpy-dev python3-pybind11 python3-distutils && sudo pip3 install tox
  17. run: pip3 install tox
  18. - name: Python initial test
  19. working-directory: ${{github.workspace}}
  20. run: tox run
  21. build:
  22. # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
  23. # You can convert this to a matrix build if you need cross-platform coverage.
  24. # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
  25. runs-on: ubuntu-latest
  26. steps:
  27. - uses: actions/checkout@v3
  28. # without GTest and Boost
  29. - name: Install Python NumPy and Pybind11
  30. # run: sudo apt install python3-numpy python3-all-dev python-numpy-dev python3-pybind11 python3-distutils && sudo pip3 install tox
  31. run: sudo apt install python3-numpy python3-all-dev python3-pybind11 python3-distutils && sudo pip3 install tox
  32. - name: Python initial test
  33. working-directory: ${{github.workspace}}
  34. run: tox run
  35. - name: Configure CMake
  36. # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
  37. # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
  38. run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
  39. - name: Build
  40. # Build your program with the given configuration
  41. run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
  42. - name: Test
  43. working-directory: ${{github.workspace}}/build
  44. # Execute tests defined by the CMake configuration.
  45. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
  46. run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure
  47. ##################################################################
  48. # Do just the same but now with Google Test lib for C++ part
  49. ##################################################################
  50. - name: install Google Test
  51. run: sudo apt install libgtest-dev
  52. - name: Configure CMake
  53. # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
  54. # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
  55. run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
  56. - name: Build
  57. # Build your program with the given configuration
  58. run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
  59. - name: Test
  60. working-directory: ${{github.workspace}}/build
  61. # Execute tests defined by the CMake configuration.
  62. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
  63. run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure
  64. ##################################################################
  65. # Do just the same but now with Boost multiprecision
  66. ##################################################################
  67. - name: install Boost (to use multiprecision)
  68. run: sudo apt install libboost-all-dev
  69. - name: Configure CMake
  70. # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
  71. # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
  72. run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
  73. - name: Build
  74. # Build your program with the given configuration
  75. run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
  76. - name: Test
  77. working-directory: ${{github.workspace}}/build
  78. # Execute tests defined by the CMake configuration.
  79. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
  80. run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure
  81. - name: Python mp test
  82. working-directory: ${{github.workspace}}
  83. run: tox run