Skip to content

Commit 40104e6

Browse files
committed
Switch M1 jobs to GitHub runners & enable them on PRs (except for the building of Linux arm64 launchers)
1 parent c8fef9d commit 40104e6

File tree

2 files changed

+151
-11
lines changed

2 files changed

+151
-11
lines changed

.github/workflows/ci.yml

Lines changed: 150 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -600,8 +600,7 @@ jobs:
600600

601601
generate-macos-m1-launcher:
602602
timeout-minutes: 120
603-
runs-on: "macOS-m1"
604-
if: github.event_name == 'push' && github.repository == 'VirtusLab/scala-cli'
603+
runs-on: "macOS-14"
605604
steps:
606605
- uses: actions/checkout@v4
607606
with:
@@ -627,19 +626,86 @@ jobs:
627626
if-no-files-found: error
628627
retention-days: 2
629628

630-
native-macos-m1-tests:
629+
native-macos-m1-tests-1:
631630
needs: generate-macos-m1-launcher
632631
timeout-minutes: 120
633-
runs-on: "macOS-m1"
634-
if: github.event_name == 'push' && github.repository == 'VirtusLab/scala-cli'
632+
runs-on: "macOS-14"
635633
steps:
636634
- uses: actions/checkout@v4
637635
with:
638636
fetch-depth: 0
639637
submodules: true
640638
- 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
641649
env:
642-
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
674+
with:
675+
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")'
678+
- uses: actions/download-artifact@v3
679+
with:
680+
name: macos-m1-launchers
681+
path: artifacts/
682+
- name: Native integration tests
683+
run: ./mill -i nativeIntegrationTests
684+
env:
685+
UPDATE_GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
686+
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
643709
with:
644710
jvm: "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.2.0/graalvm-ce-java17-darwin-aarch64-22.2.0.tar.gz"
645711
- name: Ensure it's running on aarch64
@@ -653,15 +719,86 @@ jobs:
653719
env:
654720
UPDATE_GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
655721
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
656793
SCALA_CLI_SODIUM_JNI_ALLOW: false
657794
- name: Convert Mill test reports to JUnit XML format
658795
if: success() || failure()
659-
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/
660797
- name: Upload test report
661798
uses: actions/upload-artifact@v3
662799
if: success() || failure()
663800
with:
664-
name: test-results-macos-m1-tests
801+
name: test-results-macos-m1-tests-5
665802
path: test-report.xml
666803

667804
generate-windows-launcher:
@@ -1512,7 +1649,11 @@ jobs:
15121649
- native-macos-tests-3
15131650
- native-macos-tests-4
15141651
- native-macos-tests-5
1515-
- 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
15161657
- native-windows-tests-1
15171658
- native-windows-tests-2
15181659
- 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)