Skip to content

Commit 97f288c

Browse files
authored
Use mac arm runners on GHA (#1758)
1 parent 9d0267a commit 97f288c

File tree

1 file changed

+73
-30
lines changed

1 file changed

+73
-30
lines changed

.github/workflows/pr.yml

Lines changed: 73 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ jobs:
229229
retention-days: 1
230230

231231
build-jvm-macos-native-lib:
232-
runs-on: macos-12
232+
runs-on: macos-14
233233
needs: [check-cache, build-jni-swig-stub]
234234
if: |
235235
always() &&
@@ -317,6 +317,8 @@ jobs:
317317
build-kotlin-metadata-package:
318318
runs-on: ubuntu-latest
319319
needs: [check-cache]
320+
env:
321+
NDK_VERSION: 23.2.8568313
320322
if: |
321323
always() &&
322324
!cancelled() &&
@@ -395,8 +397,10 @@ jobs:
395397
# This task is also responsible for creating the Gradle and Compiler Plugin as well as
396398
# all Kotlin Multiplatform Metadata
397399
build-jvm-packages:
398-
runs-on: macos-12
400+
runs-on: macos-14
399401
needs: [check-cache, build-jvm-linux-native-lib, build-jvm-windows-native-lib, build-jvm-macos-native-lib]
402+
env:
403+
NDK_VERSION: 23.2.8568313
400404
if: |
401405
always() &&
402406
!cancelled() &&
@@ -410,11 +414,11 @@ jobs:
410414
with:
411415
submodules: "recursive"
412416

413-
- name: Setup Java 11
417+
- name: Setup Java 17
414418
uses: actions/setup-java@v3
415419
with:
416420
distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }}
417-
java-version: ${{ vars.VERSION_JAVA }}
421+
java-version: '17'
418422

419423
- name: Setup Gradle and task/dependency caching
420424
uses: gradle/gradle-build-action@v2
@@ -437,6 +441,9 @@ jobs:
437441
key: 'jvm-package'
438442
max-size: '2.0G'
439443

444+
- name: Install SWIG
445+
run: brew install swig
446+
440447
- name: Prepend ccache executables to the PATH
441448
run: echo "/usr/lib/ccache:/usr/local/opt/ccache/libexec" >> $GITHUB_PATH
442449

@@ -448,11 +455,11 @@ jobs:
448455
echo '#!/bin/bash\nccache clang "$@"%"' > /usr/local/bin/ccache-clang
449456
echo '#!/bin/bash\nccache clang++ "$@"%"' > /usr/local/bin/ccache-clang++
450457
451-
# TODO This matches 23.2.8568313, but what happens if we a define specific ndk version in our build?
452-
- name: Setup NDK
453-
uses: nttld/setup-ndk@v1
454-
with:
455-
ndk-version: r23c
458+
- name: Setup Android SDK
459+
uses: android-actions/setup-android@v2
460+
461+
- name: Install NDK
462+
run: sdkmanager --install "ndk;${{ env.NDK_VERSION }}"
456463

457464
# We cannot use artifacts as they cannot be shared between workflows, so use cache instead.
458465
- name: Setup build cache
@@ -494,6 +501,8 @@ jobs:
494501
build-android-packages:
495502
runs-on: ubuntu-latest
496503
needs: check-cache
504+
env:
505+
NDK_VERSION: 23.2.8568313
497506
outputs:
498507
baas-container-id: ${{ steps.baas_cli_start.outputs.baas_container_id }}
499508
if: |
@@ -571,11 +580,11 @@ jobs:
571580
echo '#!/bin/bash\nccache clang "$@"%"' > /usr/local/bin/ccache-clang
572581
echo '#!/bin/bash\nccache clang++ "$@"%"' > /usr/local/bin/ccache-clang++
573582
574-
# TODO This matches 23.2.8568313, but what happens if we a define specific ndk version in our build?
575-
- name: Setup NDK
576-
uses: nttld/setup-ndk@v1
577-
with:
578-
ndk-version: r23c
583+
- name: Setup Android SDK
584+
uses: android-actions/setup-android@v2
585+
586+
- name: Install NDK
587+
run: sdkmanager --install "ndk;${{ env.NDK_VERSION }}"
579588

580589
- name: Build Android Base Test Apk
581590
working-directory: packages
@@ -638,7 +647,7 @@ jobs:
638647
639648
# TODO: ccache is not being used by this build for some reason
640649
build-macos-x64-packages:
641-
runs-on: macos-12
650+
runs-on: macos-14 # x64 builds fine on an arm64 node
642651
needs: check-cache
643652
if: always() && !cancelled() && needs.check-cache.outputs.packages-macos-x64-cache-hit != 'true'
644653

@@ -675,6 +684,9 @@ jobs:
675684
key: 'macos-x64-package'
676685
max-size: '2.0G'
677686

687+
- name: Install SWIG
688+
run: brew install swig
689+
678690
- name: Prepend ccache executables to the PATH
679691
run: echo "/usr/lib/ccache:/usr/local/opt/ccache/libexec" >> $GITHUB_PATH
680692

@@ -706,7 +718,7 @@ jobs:
706718
retention-days: 1
707719

708720
build-macos-arm64-packages:
709-
runs-on: macos-12
721+
runs-on: macos-14
710722
needs: check-cache
711723
# needs: static-analysis
712724
if: always() && !cancelled() && needs.check-cache.outputs.packages-macos-arm64-cache-hit != 'true'
@@ -744,6 +756,9 @@ jobs:
744756
key: 'macos-arm64-package'
745757
max-size: '2.0G'
746758

759+
- name: Install SWIG
760+
run: brew install swig
761+
747762
- name: Prepend ccache executables to the PATH
748763
run: echo "/usr/lib/ccache:/usr/local/opt/ccache/libexec" >> $GITHUB_PATH
749764

@@ -774,7 +789,7 @@ jobs:
774789
retention-days: 1
775790

776791
build-ios-x64-packages:
777-
runs-on: macos-12
792+
runs-on: macos-14 # x64 builds fine on an arm64 node
778793
needs: check-cache
779794
# needs: static-analysis
780795
if: always() && !cancelled() && needs.check-cache.outputs.packages-ios-x64-cache-hit != 'true'
@@ -812,6 +827,9 @@ jobs:
812827
key: 'ios-x64-package'
813828
max-size: '2.0G'
814829

830+
- name: Install SWIG
831+
run: brew install swig
832+
815833
- name: Prepend ccache executables to the PATH
816834
run: echo "/usr/lib/ccache:/usr/local/opt/ccache/libexec" >> $GITHUB_PATH
817835

@@ -843,7 +861,7 @@ jobs:
843861
retention-days: 1
844862

845863
build-ios-arm64-packages:
846-
runs-on: macos-12
864+
runs-on: macos-14
847865
needs: check-cache
848866
# needs: static-analysis
849867
if: always() && !cancelled() && needs.check-cache.outputs.packages-ios-arm64-cache-hit != 'true'
@@ -881,6 +899,9 @@ jobs:
881899
key: 'ios-arm64-package'
882900
max-size: '2.0G'
883901

902+
- name: Install SWIG
903+
run: brew install swig
904+
884905
- name: Prepend ccache executables to the PATH
885906
run: echo "/usr/lib/ccache:/usr/local/opt/ccache/libexec" >> $GITHUB_PATH
886907

@@ -931,7 +952,7 @@ jobs:
931952
- type: sync
932953
test-title: Unit Test Results - Android Sync (Emulator)
933954

934-
runs-on: macos-12
955+
runs-on: macos-12 # android emulator does not run on arm64 - https://github.com/ReactiveCircus/android-emulator-runner/issues/350
935956
needs: [check-cache, build-android-packages, build-jvm-packages, build-kotlin-metadata-package]
936957
if: |
937958
always() &&
@@ -1175,7 +1196,7 @@ jobs:
11751196
strategy:
11761197
fail-fast: false
11771198
matrix:
1178-
os: [macos-12] # , macos-arm]
1199+
os: [macos-12, macos-14]
11791200
type: [base, sync]
11801201
include:
11811202
- os: macos-12
@@ -1188,14 +1209,21 @@ jobs:
11881209
os-id: macos
11891210
package-prefix: macos-x64
11901211
test-title: Unit Test Results - MacOS x64 Sync
1191-
# - os: macos-arm
1192-
# package-prefix: macos-arm64
1193-
# test-title: Results - MacOS arm64 Base
1212+
- os: macos-14
1213+
type: base
1214+
os-id: macos
1215+
package-prefix: macos-arm64
1216+
test-title: Unit Test Results - MacOS arm64 Base
1217+
- os: macos-14
1218+
type: sync
1219+
os-id: macos
1220+
package-prefix: macos-arm64
1221+
test-title: Unit Test Results - MacOS arm64 Sync
11941222

11951223
runs-on: ${{ matrix.os }}
11961224
# TODO Unclear why MacOS needs the metadata package when the Android Tests do not
11971225
# Disable macos-arm for now as the host needs to have the Android SDK installed even though it isn't really using it.
1198-
needs: [check-cache, build-macos-x64-packages, build-kotlin-metadata-package] #, build-macos-arm64-packages]
1226+
needs: [check-cache, build-kotlin-metadata-package, build-macos-x64-packages, build-macos-arm64-packages]
11991227
if: |
12001228
always() &&
12011229
!cancelled() &&
@@ -1297,7 +1325,7 @@ jobs:
12971325
strategy:
12981326
fail-fast: false
12991327
matrix:
1300-
os: [macos-12] # , macos-arm]
1328+
os: [macos-12, macos-14]
13011329
type: [base, sync]
13021330
include:
13031331
- os: macos-12
@@ -1310,14 +1338,21 @@ jobs:
13101338
package-prefix: x64
13111339
test-title: Unit Test Results - iOS x64 Sync
13121340
test-task: iosTest
1313-
# - os: macos-arm
1314-
# package-prefix: macos-arm64
1315-
# test-title: Results - MacOS arm64 Base
1341+
- os: macos-14
1342+
type: base
1343+
package-prefix: arm64
1344+
test-title: Unit Test Results - iOS arm64 Base
1345+
test-task: iosTest
1346+
- os: macos-14
1347+
type: sync
1348+
package-prefix: arm64
1349+
test-title: Unit Test Results - iOS arm64 Sync
1350+
test-task: iosTest
13161351

13171352
runs-on: ${{ matrix.os }}
13181353
# TODO Unclear why MacOS needs the metadata package when the Android Tests do not
13191354
# Disable macos-arm for now as the host needs to have the Android SDK installed even though it isn't really using it.
1320-
needs: [check-cache, build-ios-x64-packages, build-kotlin-metadata-package] # , build-ios-arm64-packages]
1355+
needs: [check-cache, build-kotlin-metadata-package, build-ios-x64-packages, build-ios-arm64-packages]
13211356
if: |
13221357
always() &&
13231358
!cancelled() &&
@@ -1419,13 +1454,17 @@ jobs:
14191454
strategy:
14201455
fail-fast: false
14211456
matrix:
1422-
os: [macos-12, ubuntu-latest, windows-latest] # TODO Should we also test om MacOS arm64?
1457+
os: [macos-12, macos-14, ubuntu-latest, windows-latest]
14231458
type: [base, sync]
14241459
include:
14251460
- os: macos-12
14261461
os-id: mac
14271462
type: base
14281463
test-title: Unit Test Results - Base JVM MacOS x64
1464+
- os: macos-14
1465+
os-id: mac
1466+
type: base
1467+
test-title: Unit Test Results - Base JVM MacOS arm64
14291468
- os: ubuntu-latest
14301469
os-id: ubu
14311470
type: base
@@ -1438,6 +1477,10 @@ jobs:
14381477
os-id: mac
14391478
type: sync
14401479
test-title: Unit Test Results - Sync JVM MacOS x64
1480+
- os: macos-14
1481+
os-id: mac
1482+
type: sync
1483+
test-title: Unit Test Results - Sync JVM MacOS arm64
14411484
- os: ubuntu-latest
14421485
os-id: ubu
14431486
type: sync

0 commit comments

Comments
 (0)