Skip to content

Commit 20dd901

Browse files
authored
Merge pull request #3050 from Gedochao/maintenance/migrate-to-gh-macos-m1
Switch to GitHub M1/`aarch64` runners on the CI
2 parents b397fe4 + 40104e6 commit 20dd901

File tree

2 files changed

+171
-14
lines changed

2 files changed

+171
-14
lines changed

.github/workflows/ci.yml

Lines changed: 170 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,9 @@ jobs:
380380
submodules: true
381381
- uses: VirtusLab/scala-cli-setup@v1
382382
with:
383-
apps: ""
383+
jvm: "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.2.0/graalvm-ce-java17-darwin-aarch64-22.2.0.tar.gz"
384+
- name: Ensure it's running on aarch64
385+
run: scala-cli -e 'assert(System.getProperty("os.arch") == "aarch64")'
384386
- name: Generate native launcher and generate os packages
385387
run: .github/scripts/build-linux-aarch64.sh
386388
env:
@@ -404,6 +406,8 @@ jobs:
404406
- uses: VirtusLab/scala-cli-setup@v1
405407
with:
406408
jvm: "temurin:17"
409+
- name: Ensure it's not running on aarch64
410+
run: scala-cli -e 'assert(System.getProperty("os.arch") != "aarch64")'
407411
- name: Generate native launcher
408412
run: .github/scripts/generate-native-image.sh
409413
- run: ./mill -i ci.setShouldPublish
@@ -431,6 +435,8 @@ jobs:
431435
- uses: VirtusLab/scala-cli-setup@v1
432436
with:
433437
jvm: "temurin:17"
438+
- name: Ensure it's not running on aarch64
439+
run: scala-cli -e 'assert(System.getProperty("os.arch") != "aarch64")'
434440
- uses: actions/download-artifact@v3
435441
with:
436442
name: macos-launchers
@@ -464,6 +470,8 @@ jobs:
464470
- uses: VirtusLab/scala-cli-setup@v1
465471
with:
466472
jvm: "temurin:17"
473+
- name: Ensure it's not running on aarch64
474+
run: scala-cli -e 'assert(System.getProperty("os.arch") != "aarch64")'
467475
- uses: actions/download-artifact@v3
468476
with:
469477
name: macos-launchers
@@ -497,6 +505,8 @@ jobs:
497505
- uses: VirtusLab/scala-cli-setup@v1
498506
with:
499507
jvm: "temurin:17"
508+
- name: Ensure it's not running on aarch64
509+
run: scala-cli -e 'assert(System.getProperty("os.arch") != "aarch64")'
500510
- uses: actions/download-artifact@v3
501511
with:
502512
name: macos-launchers
@@ -530,6 +540,8 @@ jobs:
530540
- uses: VirtusLab/scala-cli-setup@v1
531541
with:
532542
jvm: "temurin:17"
543+
- name: Ensure it's not running on aarch64
544+
run: scala-cli -e 'assert(System.getProperty("os.arch") != "aarch64")'
533545
- uses: actions/download-artifact@v3
534546
with:
535547
name: macos-launchers
@@ -563,6 +575,8 @@ jobs:
563575
- uses: VirtusLab/scala-cli-setup@v1
564576
with:
565577
jvm: "temurin:17"
578+
- name: Ensure it's not running on aarch64
579+
run: scala-cli -e 'assert(System.getProperty("os.arch") != "aarch64")'
566580
- uses: actions/download-artifact@v3
567581
with:
568582
name: macos-launchers
@@ -586,17 +600,17 @@ jobs:
586600

587601
generate-macos-m1-launcher:
588602
timeout-minutes: 120
589-
runs-on: "macOS-m1"
590-
if: github.event_name == 'push' && github.repository == 'VirtusLab/scala-cli'
603+
runs-on: "macOS-14"
591604
steps:
592605
- uses: actions/checkout@v4
593606
with:
594607
fetch-depth: 0
595608
submodules: true
596-
- uses: coursier/setup-action@7bde40eee928896f074dbb76d22dd772eed5c65f
609+
- uses: VirtusLab/scala-cli-setup@v1
597610
with:
598-
apps: ""
599611
jvm: "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.2.0/graalvm-ce-java17-darwin-aarch64-22.2.0.tar.gz"
612+
- name: Ensure it's running on aarch64
613+
run: scala-cli -e 'assert(System.getProperty("os.arch") == "aarch64")'
600614
- name: Generate native launcher
601615
run: .github/scripts/generate-native-image.sh
602616
- run: ./mill -i ci.setShouldPublish
@@ -612,21 +626,55 @@ jobs:
612626
if-no-files-found: error
613627
retention-days: 2
614628

615-
native-macos-m1-tests:
629+
native-macos-m1-tests-1:
616630
needs: generate-macos-m1-launcher
617631
timeout-minutes: 120
618-
runs-on: "macOS-m1"
619-
if: github.event_name == 'push' && github.repository == 'VirtusLab/scala-cli'
632+
runs-on: "macOS-14"
620633
steps:
621634
- uses: actions/checkout@v4
622635
with:
623636
fetch-depth: 0
624637
submodules: true
625638
- uses: VirtusLab/scala-cli-setup@v1
639+
with:
640+
jvm: "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.2.0/graalvm-ce-java17-darwin-aarch64-22.2.0.tar.gz"
641+
- name: Ensure it's running on aarch64
642+
run: scala-cli -e 'assert(System.getProperty("os.arch") == "aarch64")'
643+
- uses: actions/download-artifact@v3
644+
with:
645+
name: macos-m1-launchers
646+
path: artifacts/
647+
- name: Native integration tests
648+
run: ./mill -i nativeIntegrationTests
626649
env:
627-
COURSIER_BIN_DIR: ${{ github.workspace }}/cs/bin # necessary for our M1 runner setup
650+
UPDATE_GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
651+
SCALA_CLI_IT_FORCED_LAUNCHER_DIRECTORY: artifacts/
652+
SCALA_CLI_IT_GROUP: 1
653+
SCALA_CLI_SODIUM_JNI_ALLOW: false
654+
- name: Convert Mill test reports to JUnit XML format
655+
if: success() || failure()
656+
run: .github/scripts/generate-junit-reports.sc macos-m1-tests-1 'Scala CLI MacOS M1 Tests (1)' test-report.xml out/
657+
- name: Upload test report
658+
uses: actions/upload-artifact@v3
659+
if: success() || failure()
660+
with:
661+
name: test-results-macos-m1-tests-1
662+
path: test-report.xml
663+
664+
native-macos-m1-tests-2:
665+
needs: generate-macos-m1-launcher
666+
timeout-minutes: 120
667+
runs-on: "macOS-14"
668+
steps:
669+
- uses: actions/checkout@v4
670+
with:
671+
fetch-depth: 0
672+
submodules: true
673+
- uses: VirtusLab/scala-cli-setup@v1
628674
with:
629675
jvm: "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.2.0/graalvm-ce-java17-darwin-aarch64-22.2.0.tar.gz"
676+
- name: Ensure it's running on aarch64
677+
run: scala-cli -e 'assert(System.getProperty("os.arch") == "aarch64")'
630678
- uses: actions/download-artifact@v3
631679
with:
632680
name: macos-m1-launchers
@@ -636,15 +684,121 @@ jobs:
636684
env:
637685
UPDATE_GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
638686
SCALA_CLI_IT_FORCED_LAUNCHER_DIRECTORY: artifacts/
687+
SCALA_CLI_IT_GROUP: 2
688+
SCALA_CLI_SODIUM_JNI_ALLOW: false
689+
- name: Convert Mill test reports to JUnit XML format
690+
if: success() || failure()
691+
run: .github/scripts/generate-junit-reports.sc macos-m1-tests-2 'Scala CLI MacOS M1 Tests (2)' test-report.xml out/
692+
- name: Upload test report
693+
uses: actions/upload-artifact@v3
694+
if: success() || failure()
695+
with:
696+
name: test-results-macos-m1-tests-2
697+
path: test-report.xml
698+
699+
native-macos-m1-tests-3:
700+
needs: generate-macos-m1-launcher
701+
timeout-minutes: 120
702+
runs-on: "macOS-14"
703+
steps:
704+
- uses: actions/checkout@v4
705+
with:
706+
fetch-depth: 0
707+
submodules: true
708+
- uses: VirtusLab/scala-cli-setup@v1
709+
with:
710+
jvm: "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.2.0/graalvm-ce-java17-darwin-aarch64-22.2.0.tar.gz"
711+
- name: Ensure it's running on aarch64
712+
run: scala-cli -e 'assert(System.getProperty("os.arch") == "aarch64")'
713+
- uses: actions/download-artifact@v3
714+
with:
715+
name: macos-m1-launchers
716+
path: artifacts/
717+
- name: Native integration tests
718+
run: ./mill -i nativeIntegrationTests
719+
env:
720+
UPDATE_GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
721+
SCALA_CLI_IT_FORCED_LAUNCHER_DIRECTORY: artifacts/
722+
SCALA_CLI_IT_GROUP: 3
723+
SCALA_CLI_SODIUM_JNI_ALLOW: false
724+
- name: Convert Mill test reports to JUnit XML format
725+
if: success() || failure()
726+
run: .github/scripts/generate-junit-reports.sc macos-m1-tests-3 'Scala CLI MacOS M1 Tests (3)' test-report.xml out/
727+
- name: Upload test report
728+
uses: actions/upload-artifact@v3
729+
if: success() || failure()
730+
with:
731+
name: test-results-macos-m1-tests-3
732+
path: test-report.xml
733+
734+
native-macos-m1-tests-4:
735+
needs: generate-macos-m1-launcher
736+
timeout-minutes: 120
737+
runs-on: "macOS-14"
738+
steps:
739+
- uses: actions/checkout@v4
740+
with:
741+
fetch-depth: 0
742+
submodules: true
743+
- uses: VirtusLab/scala-cli-setup@v1
744+
with:
745+
jvm: "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.2.0/graalvm-ce-java17-darwin-aarch64-22.2.0.tar.gz"
746+
- name: Ensure it's running on aarch64
747+
run: scala-cli -e 'assert(System.getProperty("os.arch") == "aarch64")'
748+
- uses: actions/download-artifact@v3
749+
with:
750+
name: macos-m1-launchers
751+
path: artifacts/
752+
- name: Native integration tests
753+
run: ./mill -i nativeIntegrationTests
754+
env:
755+
UPDATE_GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
756+
SCALA_CLI_IT_FORCED_LAUNCHER_DIRECTORY: artifacts/
757+
SCALA_CLI_IT_GROUP: 4
758+
SCALA_CLI_SODIUM_JNI_ALLOW: false
759+
- name: Convert Mill test reports to JUnit XML format
760+
if: success() || failure()
761+
run: .github/scripts/generate-junit-reports.sc macos-m1-tests-4 'Scala CLI MacOS M1 Tests (4)' test-report.xml out/
762+
- name: Upload test report
763+
uses: actions/upload-artifact@v3
764+
if: success() || failure()
765+
with:
766+
name: test-results-macos-m1-tests-4
767+
path: test-report.xml
768+
769+
native-macos-m1-tests-5:
770+
needs: generate-macos-m1-launcher
771+
timeout-minutes: 120
772+
runs-on: "macOS-14"
773+
steps:
774+
- uses: actions/checkout@v4
775+
with:
776+
fetch-depth: 0
777+
submodules: true
778+
- uses: VirtusLab/scala-cli-setup@v1
779+
with:
780+
jvm: "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.2.0/graalvm-ce-java17-darwin-aarch64-22.2.0.tar.gz"
781+
- name: Ensure it's running on aarch64
782+
run: scala-cli -e 'assert(System.getProperty("os.arch") == "aarch64")'
783+
- uses: actions/download-artifact@v3
784+
with:
785+
name: macos-m1-launchers
786+
path: artifacts/
787+
- name: Native integration tests
788+
run: ./mill -i nativeIntegrationTests
789+
env:
790+
UPDATE_GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
791+
SCALA_CLI_IT_FORCED_LAUNCHER_DIRECTORY: artifacts/
792+
SCALA_CLI_IT_GROUP: 5
639793
SCALA_CLI_SODIUM_JNI_ALLOW: false
640794
- name: Convert Mill test reports to JUnit XML format
641795
if: success() || failure()
642-
run: .github/scripts/generate-junit-reports.sc macos-m1-tests 'Scala CLI MacOS M1 Tests' test-report.xml out/
796+
run: .github/scripts/generate-junit-reports.sc macos-m1-tests-5 'Scala CLI MacOS M1 Tests (5)' test-report.xml out/
643797
- name: Upload test report
644798
uses: actions/upload-artifact@v3
645799
if: success() || failure()
646800
with:
647-
name: test-results-macos-m1-tests
801+
name: test-results-macos-m1-tests-5
648802
path: test-report.xml
649803

650804
generate-windows-launcher:
@@ -1495,7 +1649,11 @@ jobs:
14951649
- native-macos-tests-3
14961650
- native-macos-tests-4
14971651
- native-macos-tests-5
1498-
- native-macos-m1-tests
1652+
- native-macos-m1-tests-1
1653+
- native-macos-m1-tests-2
1654+
- native-macos-m1-tests-3
1655+
- native-macos-m1-tests-4
1656+
- native-macos-m1-tests-5
14991657
- native-windows-tests-1
15001658
- native-windows-tests-2
15011659
- native-windows-tests-3

modules/integration/src/test/scala/scala/cli/integration/PublishSetupTests.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,7 @@ class PublishSetupTests extends ScalaCliSuite {
8989
.toMap
9090
}
9191

92-
override def munitFlakyOK =
93-
TestUtil.isCI && TestUtil.isNativeCli && Properties.isMac && !TestUtil.isM1
92+
override def munitFlakyOK = TestUtil.isCI && TestUtil.isNativeCli && Properties.isMac
9493

9594
test("local") {
9695
val expectedDirectives = Map(

0 commit comments

Comments
 (0)