Skip to content

Commit 14183ea

Browse files
ci(build): Add MacOS ARM CI job (endless-sky#10561)
Co-authored-by: tibetiroka <68112292+tibetiroka@users.noreply.github.com>
1 parent 1eceb4d commit 14183ea

File tree

3 files changed

+78
-0
lines changed

3 files changed

+78
-0
lines changed

.github/workflows/ci.yml

+36
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,42 @@ jobs:
228228
run: ctest --preset macos-ci-benchmark
229229

230230

231+
build_macos-arm:
232+
name: MacOS-ARM
233+
needs: changed
234+
if: ${{ needs.changed.outputs.game_code == 'true' || needs.changed.outputs.unit_tests == 'true' || needs.changed.outputs.cmake_files == 'true' || needs.changed.outputs.ci_config == 'true' }}
235+
runs-on: macos-14
236+
env:
237+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
238+
OUTPUT: "Endless Sky ARM CI Test"
239+
steps:
240+
- uses: actions/checkout@v4
241+
with:
242+
show-progress: false
243+
- name: Setup cached directories
244+
uses: actions/cache@v4
245+
with:
246+
path: /Users/runner/Library/Caches/Mozilla.sccache
247+
key: ${{ runner.os }}-${{ runner.arch }}-ci-sccache-${{ github.ref }}
248+
restore-keys: |
249+
${{ runner.os }}-${{ runner.arch }}-ci-sccache-refs/heads/master
250+
- name: Setup sccache
251+
uses: Mozilla-Actions/sccache-action@v0.0.5
252+
- name: Install pkg-config
253+
run: type -P pkg-config || brew install pkg-config
254+
- uses: lukka/get-cmake@latest
255+
- uses: lukka/run-vcpkg@v11
256+
with:
257+
vcpkgGitCommitId: '2cf957350da28ad032178a974607f59f961217d9'
258+
- uses: lukka/run-cmake@v10
259+
with:
260+
configurePreset: 'macos-arm-ci'
261+
buildPreset: 'macos-arm-ci'
262+
testPreset: 'macos-arm-ci'
263+
- name: Run Benchmarks
264+
run: ctest --preset macos-arm-ci-benchmark
265+
266+
231267
build_documentation_doxygen:
232268
name: Documentation Doxygen
233269
needs: changed

CMakePresets.json

+34
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,22 @@
217217
"CMAKE_OSX_DEPLOYMENT_TARGET": "10.12"
218218
}
219219
},
220+
{
221+
"name": "macos-arm-ci",
222+
"displayName": "MacOS ARM CI",
223+
"description": "Builds for MacOS ARM for CI purposes",
224+
"inherits": "ci",
225+
"architecture": {
226+
"value": "arm64",
227+
"strategy": "external"
228+
},
229+
"cacheVariables": {
230+
"VCPKG_HOST_TRIPLET": "macos-arm64-ci",
231+
"VCPKG_TARGET_TRIPLET": "macos-arm64-ci",
232+
"CMAKE_OSX_ARCHITECTURES": "arm64",
233+
"CMAKE_OSX_DEPLOYMENT_TARGET": "11"
234+
}
235+
},
220236
{
221237
"name": "clang-cl-ci",
222238
"displayName": "clang-cl CI",
@@ -434,6 +450,12 @@
434450
"configurePreset": "macos-ci",
435451
"inherits": "ci"
436452
},
453+
{
454+
"name": "macos-arm-ci",
455+
"displayName": "MacOS ARM CI build",
456+
"configurePreset": "macos-arm-ci",
457+
"inherits": "ci"
458+
},
437459
{
438460
"name": "clang-cl-ci",
439461
"displayName": "VS CI build",
@@ -844,6 +866,18 @@
844866
"configurePreset": "macos-ci",
845867
"inherits": "ci-benchmark"
846868
},
869+
{
870+
"name": "macos-arm-ci",
871+
"displayName": "MacOS CI Tests",
872+
"configurePreset": "macos-arm-ci",
873+
"inherits": "ci-integration"
874+
},
875+
{
876+
"name": "macos-arm-ci-benchmark",
877+
"displayName": "MacOS ARM CI Benchmarks",
878+
"configurePreset": "macos-arm-ci",
879+
"inherits": "ci-benchmark"
880+
},
847881
{
848882
"name": "clang-cl-ci",
849883
"displayName": "VS CI Tests",

overlays/macos-arm64-ci.cmake

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
set(VCPKG_TARGET_ARCHITECTURE arm64)
2+
set(VCPKG_CRT_LINKAGE dynamic)
3+
set(VCPKG_LIBRARY_LINKAGE dynamic)
4+
set(VCPKG_BUILD_TYPE release)
5+
6+
set(VCPKG_CMAKE_SYSTEM_NAME Darwin)
7+
set(VCPKG_OSX_ARCHITECTURES arm64)
8+
set(VCPKG_OSX_DEPLOYMENT_TARGET 11)

0 commit comments

Comments
 (0)