|
1 | | -name: cereal mac ci |
| 1 | +name: cereal mac multi-arch ci |
2 | 2 | on: [push, pull_request] |
3 | 3 |
|
4 | 4 | jobs: |
5 | 5 | test_cereal_macos: |
6 | | - runs-on: macos-latest |
| 6 | + name: ${{ matrix.name }} |
| 7 | + runs-on: ${{ matrix.os }} |
7 | 8 | strategy: |
8 | 9 | fail-fast: false |
9 | 10 | matrix: |
10 | 11 | include: |
11 | | - - CMAKE_OPTIONS: '-DWITH_WERROR=OFF -DSKIP_PORTABILITY_TEST=ON -DSKIP_PERFORMANCE_COMPARISON=ON' |
12 | | - COMPILER: 'clang++' |
13 | | - XCODE_VERSION: 15 |
14 | | - NAME: macos-latest-clang-xcode15 |
15 | | - |
16 | | - - CMAKE_OPTIONS: '-DWITH_WERROR=OFF -DSKIP_PORTABILITY_TEST=ON -DSKIP_PERFORMANCE_COMPARISON=ON' |
17 | | - COMPILER: 'clang++' |
18 | | - XCODE_VERSION: 16 |
19 | | - NAME: macos-latest-clang-xcode16 |
20 | | - name: ${{ matrix.name }} |
| 12 | + # 1. Latest Apple Silicon (Standard) |
| 13 | + - os: macos-15 |
| 14 | + arch: arm64 |
| 15 | + xcode: '16.2' |
| 16 | + name: macos-15-arm64-xcode16 |
| 17 | + |
| 18 | + # 2. Legacy Intel Support (Standard) |
| 19 | + # Note: macos-13 is retired; macos-15-intel is the modern way to hit x86_64 |
| 20 | + - os: macos-15-intel |
| 21 | + arch: x86_64 |
| 22 | + xcode: '16.0' |
| 23 | + name: macos-15-x64-xcode16 |
| 24 | + |
| 25 | + # 3. Bleeding Edge (ARM) |
| 26 | + - os: macos-26 |
| 27 | + arch: arm64 |
| 28 | + xcode: '26.0' |
| 29 | + name: macos-26-arm64-beta |
21 | 30 |
|
22 | 31 | steps: |
23 | | - - name: Checkout code |
24 | | - uses: actions/checkout@v4 |
25 | | - |
26 | | - - uses: maxim-lobanov/setup-xcode@v1 |
27 | | - with: |
28 | | - xcode-version: ${{ matrix.XCODE_VERSION }} |
29 | | - |
30 | | - - name: build and test |
31 | | - shell: bash |
32 | | - env: |
33 | | - CMAKE_OPTIONS: ${{ matrix.CMAKE_OPTIONS }} |
34 | | - COMPILER: ${{ matrix.COMPILER }} |
35 | | - run: | |
36 | | - set -ex |
37 | | - # Set compiler and env variables |
38 | | - export CXX=${COMPILER} |
39 | | - ${CXX} --version |
40 | | -
|
41 | | - # Build cereal and test |
42 | | - cmake --version |
43 | | - mkdir build && cd build |
44 | | - cmake ${CMAKE_OPTIONS} .. && make -j4 VERBOSE=1 |
45 | | - ctest . --output-on-failure |
| 32 | + - name: Checkout code |
| 33 | + uses: actions/checkout@v4 |
| 34 | + |
| 35 | + - name: Setup Xcode |
| 36 | + uses: maxim-lobanov/setup-xcode@v1 |
| 37 | + with: |
| 38 | + xcode-version: ${{ matrix.xcode }} |
| 39 | + |
| 40 | + - name: Install Dependencies |
| 41 | + run: brew install ninja ccache boost |
| 42 | + |
| 43 | + - name: Configure Cache |
| 44 | + uses: actions/cache@v4 |
| 45 | + with: |
| 46 | + path: ~/.ccache |
| 47 | + key: ${{ runner.os }}-${{ matrix.arch }}-ccache-${{ github.sha }} |
| 48 | + restore-keys: ${{ runner.os }}-${{ matrix.arch }}-ccache- |
| 49 | + |
| 50 | + - name: Build and Verify Architecture |
| 51 | + shell: bash |
| 52 | + run: | |
| 53 | + # Verify we are on the expected architecture |
| 54 | + EXPECTED_ARCH="${{ matrix.arch }}" |
| 55 | + ACTUAL_ARCH=$(uname -m) |
| 56 | + echo "Expected: $EXPECTED_ARCH, Actual: $ACTUAL_ARCH" |
| 57 | + if [ "$EXPECTED_ARCH" == "x86_64" ] && [ "$ACTUAL_ARCH" != "x86_64" ]; then exit 1; fi |
| 58 | +
|
| 59 | + # Modern CMake Build |
| 60 | + export PATH="/opt/homebrew/opt/ccache/libexec:$PATH" |
| 61 | + cmake -S . -B build -G Ninja \ |
| 62 | + -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ |
| 63 | + -DWITH_WERROR=ON \ |
| 64 | + -DCMAKE_BUILD_TYPE=Release |
| 65 | +
|
| 66 | + cmake --build build --parallel 4 |
| 67 | +
|
| 68 | + - name: Run Tests |
| 69 | + run: | |
| 70 | + cd build |
| 71 | + ctest --output-on-failure --parallel 4 |
0 commit comments