Skip to content

Commit

Permalink
Install sbt via brew on macos runners
Browse files Browse the repository at this point in the history
  • Loading branch information
armanbilge committed Feb 22, 2024
1 parent 77b8fe1 commit 22ad467
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 2 deletions.
35 changes: 34 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ jobs:
name: Build and Test
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]

This comment was marked as off-topic.

Copy link
@Samet1994

Samet1994 Feb 27, 2024

TMKewbS49vzCD9WQdZhjgVjz5yz8NHfEbd

os:
- ubuntu-latest
- macos-latest
- macos-14
- windows-latest
scala: [2.12]
java:
- temurin@8
Expand All @@ -55,26 +59,38 @@ jobs:
exclude:
- java: temurin@11
os: macos-latest
- java: temurin@11
os: macos-14
- java: temurin@11
os: windows-latest
- java: temurin@17
os: macos-latest
- java: temurin@17
os: macos-14
- java: temurin@17
os: windows-latest
- java: graal_22.3.2@11
os: macos-latest
- java: graal_22.3.2@11
os: macos-14
- java: graal_22.3.2@11
os: windows-latest
- java: graalvm@17
os: macos-latest
- java: graalvm@17
os: macos-14
- java: graalvm@17
os: windows-latest
- java: corretto@17
os: macos-latest
- java: corretto@17
os: macos-14
- java: corretto@17
os: windows-latest
- java: semeru@17
os: macos-latest
- java: semeru@17
os: macos-14
- java: semeru@17
os: windows-latest
runs-on: ${{ matrix.os }}
Expand All @@ -85,6 +101,11 @@ jobs:
shell: bash
run: git config --global core.autocrlf false

- name: Install sbt
if: contains(runner.os, 'macos')
shell: bash
run: brew install sbt

- name: Checkout current branch (full)
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -248,6 +269,10 @@ jobs:
if: contains(runner.os, 'windows')
run: git config --global core.autocrlf false

- name: Install sbt
if: contains(runner.os, 'macos')
run: brew install sbt

- name: Checkout current branch (full)
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -391,6 +416,10 @@ jobs:
if: contains(runner.os, 'windows')
run: git config --global core.autocrlf false

- name: Install sbt
if: contains(runner.os, 'macos')
run: brew install sbt

- name: Checkout current branch (full)
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -530,6 +559,10 @@ jobs:
if: contains(runner.os, 'windows')
run: git config --global core.autocrlf false

- name: Install sbt
if: contains(runner.os, 'macos')
run: brew install sbt

- name: Checkout current branch (full)
uses: actions/checkout@v4
with:
Expand Down
1 change: 1 addition & 0 deletions .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ pull_request_rules:
- status-success=Build and Test (ubuntu-latest, 2.12, corretto@17, sbt-typelevelJVM)
- status-success=Build and Test (ubuntu-latest, 2.12, semeru@17, sbt-typelevelJVM)
- status-success=Build and Test (macos-latest, 2.12, temurin@8, sbt-typelevelJVM)
- status-success=Build and Test (macos-14, 2.12, temurin@8, sbt-typelevelJVM)
- status-success=Build and Test (windows-latest, 2.12, temurin@8, sbt-typelevelJVM)
- status-success=Validate Steward Config (ubuntu-latest, temurin@11)
- status-success=Generate Site (ubuntu-latest, temurin@11)
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ThisBuild / githubWorkflowJavaVersions ++= Seq(
JavaSpec.semeru("17")
)

ThisBuild / githubWorkflowOSes ++= Seq("macos-latest", "windows-latest")
ThisBuild / githubWorkflowOSes ++= Seq("macos-latest", "macos-14", "windows-latest")

ThisBuild / githubWorkflowBuildMatrixExclusions ++= {
for {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,7 @@ ${indent(jobs.map(compileJob(_, sbt)).mkString("\n\n"), 1)}
private lazy val internalTargetAggregation =
settingKey[Seq[File]]("Aggregates target directories from all subprojects")

private val macosGuard = Some("contains(runner.os, 'macos')")
private val windowsGuard = Some("contains(runner.os, 'windows')")

private val PlatformSep = FileSystems.getDefault.getSeparator
Expand Down Expand Up @@ -785,7 +786,16 @@ ${indent(jobs.map(compileJob(_, sbt)).mkString("\n\n"), 1)}
Nil
}

val brewInstallSbtOpt = if (githubWorkflowOSes.value.exists(_.contains("macos"))) {
List(
WorkflowStep
.Run(List("brew install sbt"), name = Some("Install sbt"), cond = macosGuard))
} else {
Nil
}

autoCrlfOpt :::
brewInstallSbtOpt :::
List(WorkflowStep.CheckoutFull) :::
WorkflowStep.SetupJava(githubWorkflowJavaVersions.value.toList) :::
githubWorkflowGeneratedCacheSteps.value.toList
Expand Down

0 comments on commit 22ad467

Please sign in to comment.