Skip to content

Commit

Permalink
ci/macos: add ARM64 job using XCode 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
benoit-pierre committed Oct 5, 2024
1 parent 2dd5bae commit 05be41d
Showing 1 changed file with 23 additions and 11 deletions.
34 changes: 23 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,29 @@ jobs:
strategy:
fail-fast: false
matrix:
platform: ['arm64', 'x86_64']

runs-on: ${{ matrix.platform == 'arm64' && 'macos-14' || 'macos-13' }}
include:
- image: '13'
platform: 'x86-64'
xcode_version: '15.2'
deployment_target: '10.15'
- image: '14'
platform: 'ARM64'
xcode_version: '15.4'
deployment_target: '11.0'
- image: '15'
platform: 'ARM64'
xcode_version: '16.0'
deployment_target: '14.6.1'

name: "macOS ${{ matrix.image }} ${{ matrix.platform }} 🔨${{ matrix.xcode_version }} 🎯${{ matrix.deployment_target }}"

runs-on: "macos-${{ matrix.image }}"

env:
# Bump number to reset all caches.
CACHE_EPOCH: '1'
# Bump first number to reset all caches.
CACHE_KEY: "1-macOS-${{ matrix.image }}-${{ matrix.platform }}-XC${{ matrix.xcode_version }}-DT${{ matrix.deployment_target }}"
CLICOLOR_FORCE: '1'
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.platform == 'arm64' && '11.0' || '10.15' }}
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.deployment_target }}
MAKEFLAGS: 'OUTPUT_DIR=build'

steps:
Expand All @@ -34,9 +48,7 @@ jobs:

- name: XCode version
run: |
# NOTE: don't forget to bump `CACHE_EPOCH`
# above when changing the XCode version.
sudo xcode-select -s /Applications/Xcode_${{ matrix.platform == 'arm64' && '15.4' || 15.2 }}.app
sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode_version }}.app
xcodebuild -version
xcode-select -p
Expand Down Expand Up @@ -113,7 +125,7 @@ jobs:
uses: actions/cache/restore@v4
with:
path: build
key: ${{ env.CACHE_EPOCH }}-${{ runner.os }}-${{ runner.arch }}-build-${{ hashFiles('cache-key') }}
key: ${{ env.CACHE_KEY }}-build-${{ hashFiles('cache-key') }}

- name: Restore build cache
id: ccache-restore
Expand All @@ -122,7 +134,7 @@ jobs:
with:
path: /Users/runner/Library/Caches/ccache
key: ${{ env.CACHE_KEY }}-ccache-${{ hashFiles('cache-key') }}
restore-keys: ${{ env.KEY }}-ccache-
restore-keys: ${{ env.CACHE_KEY }}-ccache-

- name: Install ccache
if: steps.build-restore.outputs.cache-hit != 'true'
Expand Down

0 comments on commit 05be41d

Please sign in to comment.