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