diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 08080f583e..4eeb506bc2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,11 +50,14 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macOS-12] + os: [ubuntu-latest, windows-latest, macOS-12, macOS-14] steps: - uses: actions/checkout@v4 with: submodules: true + - uses: coursier/setup-action@v1 + with: + apps: 'sbt' - uses: graalvm/setup-graalvm@v1 with: version: '22.3.0' @@ -79,7 +82,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macOS-12] + os: [ubuntu-latest, windows-latest, macOS-12, macOS-14] jdk: ["22.3.0", "17"] name: Test ${{ matrix.os }} -- ${{ matrix.jdk }} @@ -96,6 +99,11 @@ jobs: with: jvm: 'temurin:17' if: matrix.jdk == '17' + + - uses: coursier/setup-action@v1 + with: + apps: 'sbt' + if: matrix.jdk == '22.3.0' - uses: coursier/cache-action@v6 @@ -136,12 +144,14 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-20.04, macOS-12, windows-latest] + os: [ubuntu-20.04, macOS-12, macOS-14, windows-latest] include: - os: ubuntu-20.04 artifact: bloop-linux - os: macos-12 artifact: bloop-macos + - os: macos-14 + artifact: bloop-macos-m1 - os: windows-latest artifact: bloop-windows env: @@ -164,6 +174,10 @@ jobs: native-image-job-reports: 'true' github-token: ${{ secrets.GITHUB_TOKEN }} + - uses: coursier/setup-action@v1 + with: + apps: 'sbt' + - name: Publish GraalVM Native artifacts run: sbt "cli/graalvm-native-image:packageBin" diff --git a/frontend/src/main/scala/bloop/util/CrossPlatform.scala b/frontend/src/main/scala/bloop/util/CrossPlatform.scala index b0f7b57832..5c9f0c8cd4 100644 --- a/frontend/src/main/scala/bloop/util/CrossPlatform.scala +++ b/frontend/src/main/scala/bloop/util/CrossPlatform.scala @@ -6,4 +6,5 @@ object CrossPlatform { val OS: String = System.getProperty("os.name").toLowerCase(Locale.ENGLISH) val isWindows: Boolean = OS.contains("windows") val isMac: Boolean = OS.contains("mac") + val isM1: Boolean = sys.props.getOrElse("os.arch", "").toLowerCase(Locale.ROOT) == "aarch64" } diff --git a/frontend/src/test/scala/bloop/JavaVersionSpec.scala b/frontend/src/test/scala/bloop/JavaVersionSpec.scala index 1e8fba9bba..8af5b8bbf5 100644 --- a/frontend/src/test/scala/bloop/JavaVersionSpec.scala +++ b/frontend/src/test/scala/bloop/JavaVersionSpec.scala @@ -5,6 +5,7 @@ import bloop.config.Config import bloop.logging.RecordingLogger import bloop.util.TestProject import bloop.util.TestUtil +import bloop.util.CrossPlatform object JavaVersionSpec extends bloop.testing.BaseSuite { @@ -47,20 +48,23 @@ object JavaVersionSpec extends bloop.testing.BaseSuite { } } - test("flag-is-added-correctly") { - checkFlag(Nil) - } + if (!CrossPlatform.isM1) { - test("flag-is-not-added-correctly") { - checkFlag(List("-release", "8")) - checkFlag(List("-release:8")) - } + test("flag-is-added-correctly") { + checkFlag(Nil) + } - test("compiles-with-11") { - checkFlag(Nil, jdkVersion = "11") - } + test("flag-is-not-added-correctly") { + checkFlag(List("-release", "8")) + checkFlag(List("-release:8")) + } + + test("compiles-with-11") { + checkFlag(Nil, jdkVersion = "11") + } - test("compiles-with-17") { - checkFlag(Nil, jdkVersion = "17") + test("compiles-with-17") { + checkFlag(Nil, jdkVersion = "17") + } } } diff --git a/project/BuildPlugin.scala b/project/BuildPlugin.scala index 5023e91d26..f3557a13fa 100644 --- a/project/BuildPlugin.scala +++ b/project/BuildPlugin.scala @@ -109,12 +109,17 @@ object BuildKeys { baseDir / "bloop-artifacts" / "bloop-linux" / "bloop-linux" val originBloopMacosBinary = baseDir / "bloop-artifacts" / "bloop-macos" / "bloop-macos" + val originBloopMacosM1Binary = + baseDir / "bloop-artifacts" / "bloop-macos-m1" / "bloop-macos-m1" val targetBloopLinuxBinary = releaseTargetDir / "bloop-x86_64-pc-linux" val targetBloopWindowsBinary = releaseTargetDir / "bloop-x86_64-pc-win32.exe" val targetBloopMacosBinary = releaseTargetDir / "bloop-x86_64-apple-darwin" + val targetBloopMacosM1Binary = releaseTargetDir / "bloop-aarch64-apple-darwin" + IO.copyFile(originBloopWindowsBinary, targetBloopWindowsBinary) IO.copyFile(originBloopLinuxBinary, targetBloopLinuxBinary) IO.copyFile(originBloopMacosBinary, targetBloopMacosBinary) + IO.copyFile(originBloopMacosM1Binary, targetBloopMacosM1Binary) val originBashCompletions = baseDir / "etc" / "bash-completions" val originZshCompletions = baseDir / "etc" / "zsh-completions" @@ -134,7 +139,8 @@ object BuildKeys { targetFishCompletions, targetBloopLinuxBinary, targetBloopMacosBinary, - targetBloopWindowsBinary + targetBloopWindowsBinary, + targetBloopMacosM1Binary ) }, createLocalHomebrewFormula := ReleaseUtils.createLocalHomebrewFormula.value,