macos.yml 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. name: macOS
  2. on:
  3. push:
  4. branches: ["master"]
  5. tags: ["4.*"]
  6. pull_request:
  7. branches: ["master"]
  8. concurrency:
  9. group: ${{ github.workflow }}-${{ github.ref }}
  10. cancel-in-progress: true
  11. jobs:
  12. build:
  13. name: build + test
  14. strategy:
  15. fail-fast: false
  16. matrix:
  17. ver: ["14", "15", "26"]
  18. runs-on: macos-${{ matrix.ver }}
  19. steps:
  20. - uses: actions/checkout@v6
  21. - name: Relink `python` package in `brew`
  22. # Unlink and re-link to prevent errors when GitHub `macos` runner images
  23. # install `python` outside of `brew`, for example:
  24. # https://github.com/orgs/Homebrew/discussions/3895
  25. # https://github.com/actions/setup-python/issues/577
  26. # https://github.com/actions/runner-images/issues/6459
  27. # https://github.com/actions/runner-images/issues/6507
  28. # https://github.com/actions/runner-images/issues/2322
  29. run: brew list -1
  30. | grep python
  31. | while read formula; do brew unlink $formula; brew link --overwrite $formula; done
  32. - run: brew update
  33. - run: brew install wget pkg-config libevent openssl sqlite hiredis mongo-c-driver libmicrohttpd
  34. - run: ./configure
  35. env:
  36. PKG_CONFIG_PATH: "${{ env.PKG_CONFIG_PATH }}:/usr/local/opt/[email protected]/lib/pkgconfig"
  37. - run: make
  38. - run: make check
  39. - run: ./run_tests.sh
  40. working-directory: examples/
  41. - run: ./run_tests_conf.sh
  42. working-directory: examples/
  43. build-cmake:
  44. name: build + test cmake
  45. strategy:
  46. fail-fast: false
  47. matrix:
  48. ver: ["15", "26"]
  49. runs-on: macos-${{ matrix.ver }}
  50. steps:
  51. - uses: actions/checkout@v6
  52. - name: Relink `python` package in `brew`
  53. # Unlink and re-link to prevent errors when GitHub `macos` runner images
  54. # install `python` outside of `brew`, for example:
  55. # https://github.com/orgs/Homebrew/discussions/3895
  56. # https://github.com/actions/setup-python/issues/577
  57. # https://github.com/actions/runner-images/issues/6459
  58. # https://github.com/actions/runner-images/issues/6507
  59. # https://github.com/actions/runner-images/issues/2322
  60. run: brew list -1
  61. | grep python
  62. | while read formula; do brew unlink $formula; brew link --overwrite $formula; done
  63. - run: brew update
  64. - run: brew install wget pkg-config libevent openssl sqlite hiredis mongo-c-driver libmicrohttpd
  65. - name: Configure
  66. run: cmake -B ${{github.workspace}}/build
  67. - name: Build
  68. run: cmake --build ${{github.workspace}}/build
  69. - run: ./run_tests.sh
  70. working-directory: examples/
  71. - run: ./run_tests_conf.sh
  72. working-directory: examples/