configure.yml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. name: Config
  2. on:
  3. workflow_dispatch:
  4. pull_request:
  5. push:
  6. branches:
  7. - master
  8. - stable
  9. - v*
  10. jobs:
  11. # This tests various versions of CMake in various combinations, to make sure
  12. # the configure step passes.
  13. cmake:
  14. strategy:
  15. fail-fast: false
  16. matrix:
  17. runs-on: [ubuntu-latest, macos-latest, windows-latest]
  18. arch: [x64]
  19. cmake: [3.18]
  20. include:
  21. - runs-on: ubuntu-latest
  22. arch: x64
  23. cmake: 3.4
  24. - runs-on: macos-latest
  25. arch: x64
  26. cmake: 3.7
  27. - runs-on: windows-2016
  28. arch: x86
  29. cmake: 3.8
  30. - runs-on: windows-2016
  31. arch: x86
  32. cmake: 3.18
  33. name: 🐍 3.7 • CMake ${{ matrix.cmake }} • ${{ matrix.runs-on }}
  34. runs-on: ${{ matrix.runs-on }}
  35. steps:
  36. - uses: actions/checkout@v2
  37. - name: Setup Python 3.7
  38. uses: actions/setup-python@v2
  39. with:
  40. python-version: 3.7
  41. architecture: ${{ matrix.arch }}
  42. - name: Prepare env
  43. run: python -m pip install -r tests/requirements.txt
  44. # An action for adding a specific version of CMake:
  45. # https://github.com/jwlawson/actions-setup-cmake
  46. - name: Setup CMake ${{ matrix.cmake }}
  47. uses: jwlawson/actions-setup-cmake@v1.8
  48. with:
  49. cmake-version: ${{ matrix.cmake }}
  50. # These steps use a directory with a space in it intentionally
  51. - name: Make build directories
  52. run: mkdir "build dir"
  53. - name: Configure
  54. working-directory: build dir
  55. shell: bash
  56. run: >
  57. cmake ..
  58. -DPYBIND11_WERROR=ON
  59. -DDOWNLOAD_CATCH=ON
  60. -DPYTHON_EXECUTABLE=$(python -c "import sys; print(sys.executable)")
  61. # Only build and test if this was manually triggered in the GitHub UI
  62. - name: Build
  63. working-directory: build dir
  64. if: github.event_name == 'workflow_dispatch'
  65. run: cmake --build . --config Release
  66. - name: Test
  67. working-directory: build dir
  68. if: github.event_name == 'workflow_dispatch'
  69. run: cmake --build . --config Release --target check