macos.yml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. name: macos
  2. on: [push, pull_request]
  3. permissions:
  4. contents: read
  5. jobs:
  6. build:
  7. strategy:
  8. matrix:
  9. os: [macos-13, macos-14]
  10. build_type: [Debug, Release]
  11. std: [11, 17, 20]
  12. shared: [""]
  13. exclude:
  14. - { os: macos-13, std: 11 }
  15. - { os: macos-13, std: 17 }
  16. include:
  17. - os: macos-14
  18. std: 23
  19. build_type: Release
  20. shared: -DBUILD_SHARED_LIBS=ON
  21. runs-on: '${{ matrix.os }}'
  22. steps:
  23. - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
  24. - name: Set timezone
  25. run: sudo systemsetup -settimezone 'Europe/Minsk'
  26. - name: Select Xcode 14.3 (macOS 13)
  27. run: sudo xcode-select -s "/Applications/Xcode_14.3.app"
  28. if: ${{ matrix.os == 'macos-13' }}
  29. - name: Create Build Environment
  30. run: cmake -E make_directory ${{runner.workspace}}/build
  31. - name: Configure
  32. working-directory: ${{runner.workspace}}/build
  33. run: |
  34. cmake -DCMAKE_BUILD_TYPE=${{matrix.build_type}} ${{matrix.shared}} \
  35. -DCMAKE_CXX_STANDARD=${{matrix.std}} \
  36. -DCMAKE_CXX_VISIBILITY_PRESET=hidden -DCMAKE_VISIBILITY_INLINES_HIDDEN=ON \
  37. -DFMT_DOC=OFF -DFMT_PEDANTIC=ON -DFMT_WERROR=ON $GITHUB_WORKSPACE
  38. - name: Build
  39. working-directory: ${{runner.workspace}}/build
  40. run: |
  41. threads=`sysctl -n hw.logicalcpu`
  42. cmake --build . --config ${{matrix.build_type}} --parallel $threads
  43. - name: Test
  44. working-directory: ${{runner.workspace}}/build
  45. run: ctest -C ${{matrix.build_type}}
  46. env:
  47. CTEST_OUTPUT_ON_FAILURE: True