Skip to content

Switch to GitHub M1/aarch64 runners on the CI #3050

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
182 changes: 170 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,9 @@ jobs:
submodules: true
- uses: VirtusLab/scala-cli-setup@v1
with:
apps: ""
jvm: "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.2.0/graalvm-ce-java17-darwin-aarch64-22.2.0.tar.gz"
- name: Ensure it's running on aarch64
run: scala-cli -e 'assert(System.getProperty("os.arch") == "aarch64")'
- name: Generate native launcher and generate os packages
run: .github/scripts/build-linux-aarch64.sh
env:
Expand All @@ -404,6 +406,8 @@ jobs:
- uses: VirtusLab/scala-cli-setup@v1
with:
jvm: "temurin:17"
- name: Ensure it's not running on aarch64
run: scala-cli -e 'assert(System.getProperty("os.arch") != "aarch64")'
- name: Generate native launcher
run: .github/scripts/generate-native-image.sh
- run: ./mill -i ci.setShouldPublish
Expand Down Expand Up @@ -431,6 +435,8 @@ jobs:
- uses: VirtusLab/scala-cli-setup@v1
with:
jvm: "temurin:17"
- name: Ensure it's not running on aarch64
run: scala-cli -e 'assert(System.getProperty("os.arch") != "aarch64")'
- uses: actions/download-artifact@v3
with:
name: macos-launchers
Expand Down Expand Up @@ -464,6 +470,8 @@ jobs:
- uses: VirtusLab/scala-cli-setup@v1
with:
jvm: "temurin:17"
- name: Ensure it's not running on aarch64
run: scala-cli -e 'assert(System.getProperty("os.arch") != "aarch64")'
- uses: actions/download-artifact@v3
with:
name: macos-launchers
Expand Down Expand Up @@ -497,6 +505,8 @@ jobs:
- uses: VirtusLab/scala-cli-setup@v1
with:
jvm: "temurin:17"
- name: Ensure it's not running on aarch64
run: scala-cli -e 'assert(System.getProperty("os.arch") != "aarch64")'
- uses: actions/download-artifact@v3
with:
name: macos-launchers
Expand Down Expand Up @@ -530,6 +540,8 @@ jobs:
- uses: VirtusLab/scala-cli-setup@v1
with:
jvm: "temurin:17"
- name: Ensure it's not running on aarch64
run: scala-cli -e 'assert(System.getProperty("os.arch") != "aarch64")'
- uses: actions/download-artifact@v3
with:
name: macos-launchers
Expand Down Expand Up @@ -563,6 +575,8 @@ jobs:
- uses: VirtusLab/scala-cli-setup@v1
with:
jvm: "temurin:17"
- name: Ensure it's not running on aarch64
run: scala-cli -e 'assert(System.getProperty("os.arch") != "aarch64")'
- uses: actions/download-artifact@v3
with:
name: macos-launchers
Expand All @@ -586,17 +600,17 @@ jobs:

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

native-macos-m1-tests:
native-macos-m1-tests-1:
needs: generate-macos-m1-launcher
timeout-minutes: 120
runs-on: "macOS-m1"
if: github.event_name == 'push' && github.repository == 'VirtusLab/scala-cli'
runs-on: "macOS-14"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- uses: VirtusLab/scala-cli-setup@v1
with:
jvm: "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.2.0/graalvm-ce-java17-darwin-aarch64-22.2.0.tar.gz"
- name: Ensure it's running on aarch64
run: scala-cli -e 'assert(System.getProperty("os.arch") == "aarch64")'
- uses: actions/download-artifact@v3
with:
name: macos-m1-launchers
path: artifacts/
- name: Native integration tests
run: ./mill -i nativeIntegrationTests
env:
COURSIER_BIN_DIR: ${{ github.workspace }}/cs/bin # necessary for our M1 runner setup
UPDATE_GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SCALA_CLI_IT_FORCED_LAUNCHER_DIRECTORY: artifacts/
SCALA_CLI_IT_GROUP: 1
SCALA_CLI_SODIUM_JNI_ALLOW: false
- name: Convert Mill test reports to JUnit XML format
if: success() || failure()
run: .github/scripts/generate-junit-reports.sc macos-m1-tests-1 'Scala CLI MacOS M1 Tests (1)' test-report.xml out/
- name: Upload test report
uses: actions/upload-artifact@v3
if: success() || failure()
with:
name: test-results-macos-m1-tests-1
path: test-report.xml

native-macos-m1-tests-2:
needs: generate-macos-m1-launcher
timeout-minutes: 120
runs-on: "macOS-14"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- uses: VirtusLab/scala-cli-setup@v1
with:
jvm: "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.2.0/graalvm-ce-java17-darwin-aarch64-22.2.0.tar.gz"
- name: Ensure it's running on aarch64
run: scala-cli -e 'assert(System.getProperty("os.arch") == "aarch64")'
- uses: actions/download-artifact@v3
with:
name: macos-m1-launchers
Expand All @@ -636,15 +684,121 @@ jobs:
env:
UPDATE_GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SCALA_CLI_IT_FORCED_LAUNCHER_DIRECTORY: artifacts/
SCALA_CLI_IT_GROUP: 2
SCALA_CLI_SODIUM_JNI_ALLOW: false
- name: Convert Mill test reports to JUnit XML format
if: success() || failure()
run: .github/scripts/generate-junit-reports.sc macos-m1-tests-2 'Scala CLI MacOS M1 Tests (2)' test-report.xml out/
- name: Upload test report
uses: actions/upload-artifact@v3
if: success() || failure()
with:
name: test-results-macos-m1-tests-2
path: test-report.xml

native-macos-m1-tests-3:
needs: generate-macos-m1-launcher
timeout-minutes: 120
runs-on: "macOS-14"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- uses: VirtusLab/scala-cli-setup@v1
with:
jvm: "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.2.0/graalvm-ce-java17-darwin-aarch64-22.2.0.tar.gz"
- name: Ensure it's running on aarch64
run: scala-cli -e 'assert(System.getProperty("os.arch") == "aarch64")'
- uses: actions/download-artifact@v3
with:
name: macos-m1-launchers
path: artifacts/
- name: Native integration tests
run: ./mill -i nativeIntegrationTests
env:
UPDATE_GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SCALA_CLI_IT_FORCED_LAUNCHER_DIRECTORY: artifacts/
SCALA_CLI_IT_GROUP: 3
SCALA_CLI_SODIUM_JNI_ALLOW: false
- name: Convert Mill test reports to JUnit XML format
if: success() || failure()
run: .github/scripts/generate-junit-reports.sc macos-m1-tests-3 'Scala CLI MacOS M1 Tests (3)' test-report.xml out/
- name: Upload test report
uses: actions/upload-artifact@v3
if: success() || failure()
with:
name: test-results-macos-m1-tests-3
path: test-report.xml

native-macos-m1-tests-4:
needs: generate-macos-m1-launcher
timeout-minutes: 120
runs-on: "macOS-14"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- uses: VirtusLab/scala-cli-setup@v1
with:
jvm: "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.2.0/graalvm-ce-java17-darwin-aarch64-22.2.0.tar.gz"
- name: Ensure it's running on aarch64
run: scala-cli -e 'assert(System.getProperty("os.arch") == "aarch64")'
- uses: actions/download-artifact@v3
with:
name: macos-m1-launchers
path: artifacts/
- name: Native integration tests
run: ./mill -i nativeIntegrationTests
env:
UPDATE_GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SCALA_CLI_IT_FORCED_LAUNCHER_DIRECTORY: artifacts/
SCALA_CLI_IT_GROUP: 4
SCALA_CLI_SODIUM_JNI_ALLOW: false
- name: Convert Mill test reports to JUnit XML format
if: success() || failure()
run: .github/scripts/generate-junit-reports.sc macos-m1-tests-4 'Scala CLI MacOS M1 Tests (4)' test-report.xml out/
- name: Upload test report
uses: actions/upload-artifact@v3
if: success() || failure()
with:
name: test-results-macos-m1-tests-4
path: test-report.xml

native-macos-m1-tests-5:
needs: generate-macos-m1-launcher
timeout-minutes: 120
runs-on: "macOS-14"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- uses: VirtusLab/scala-cli-setup@v1
with:
jvm: "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.2.0/graalvm-ce-java17-darwin-aarch64-22.2.0.tar.gz"
- name: Ensure it's running on aarch64
run: scala-cli -e 'assert(System.getProperty("os.arch") == "aarch64")'
- uses: actions/download-artifact@v3
with:
name: macos-m1-launchers
path: artifacts/
- name: Native integration tests
run: ./mill -i nativeIntegrationTests
env:
UPDATE_GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SCALA_CLI_IT_FORCED_LAUNCHER_DIRECTORY: artifacts/
SCALA_CLI_IT_GROUP: 5
SCALA_CLI_SODIUM_JNI_ALLOW: false
- name: Convert Mill test reports to JUnit XML format
if: success() || failure()
run: .github/scripts/generate-junit-reports.sc macos-m1-tests 'Scala CLI MacOS M1 Tests' test-report.xml out/
run: .github/scripts/generate-junit-reports.sc macos-m1-tests-5 'Scala CLI MacOS M1 Tests (5)' test-report.xml out/
- name: Upload test report
uses: actions/upload-artifact@v3
if: success() || failure()
with:
name: test-results-macos-m1-tests
name: test-results-macos-m1-tests-5
path: test-report.xml

generate-windows-launcher:
Expand Down Expand Up @@ -1495,7 +1649,11 @@ jobs:
- native-macos-tests-3
- native-macos-tests-4
- native-macos-tests-5
- native-macos-m1-tests
- native-macos-m1-tests-1
- native-macos-m1-tests-2
- native-macos-m1-tests-3
- native-macos-m1-tests-4
- native-macos-m1-tests-5
- native-windows-tests-1
- native-windows-tests-2
- native-windows-tests-3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ class PublishSetupTests extends ScalaCliSuite {
.toMap
}

override def munitFlakyOK =
TestUtil.isCI && TestUtil.isNativeCli && Properties.isMac && !TestUtil.isM1
override def munitFlakyOK = TestUtil.isCI && TestUtil.isNativeCli && Properties.isMac

test("local") {
val expectedDirectives = Map(
Expand Down
Loading