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