Skip to content
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

improvement: Add artifacts for M1 #2412

Merged
merged 1 commit into from
Aug 27, 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
21 changes: 18 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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 }}
Expand All @@ -95,7 +98,13 @@ jobs:
- uses: coursier/setup-action@v1
with:
jvm: 'temurin:17'
apps: 'sbt'
if: matrix.jdk == '17'

- uses: coursier/setup-action@v1
with:
apps: 'sbt'
if: matrix.os == 'macOS-14' && matrix.os == 'macOS-14'

- uses: coursier/cache-action@v6

Expand Down Expand Up @@ -136,12 +145,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:
Expand All @@ -164,6 +175,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"

Expand Down
1 change: 1 addition & 0 deletions frontend/src/main/scala/bloop/util/CrossPlatform.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
15 changes: 9 additions & 6 deletions frontend/src/test/scala/bloop/JavaVersionSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -47,13 +48,15 @@ object JavaVersionSpec extends bloop.testing.BaseSuite {
}
}

test("flag-is-added-correctly") {
checkFlag(Nil)
}
if (!CrossPlatform.isM1) {
test("flag-is-added-correctly") {
checkFlag(Nil)
}

test("flag-is-not-added-correctly") {
checkFlag(List("-release", "8"))
checkFlag(List("-release:8"))
test("flag-is-not-added-correctly") {
checkFlag(List("-release", "8"))
checkFlag(List("-release:8"))
}
}

test("compiles-with-11") {
Expand Down
8 changes: 7 additions & 1 deletion project/BuildPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -134,7 +139,8 @@ object BuildKeys {
targetFishCompletions,
targetBloopLinuxBinary,
targetBloopMacosBinary,
targetBloopWindowsBinary
targetBloopWindowsBinary,
targetBloopMacosM1Binary
)
},
createLocalHomebrewFormula := ReleaseUtils.createLocalHomebrewFormula.value,
Expand Down
Loading