Skip to content

Commit

Permalink
Merge pull request #43 from mkurz/macos-latest_no-sbt
Browse files Browse the repository at this point in the history
CI: Use `macos-latest`, exclude `temurin@8`/`macos-latest` and manually install `sbt`
  • Loading branch information
mkurz authored May 13, 2024
2 parents e00b6f1 + 17b2b26 commit 6f2f4b5
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,12 @@ jobs:
name: Build and Test
strategy:
matrix:
os: [ubuntu-latest, macos-12]
os: [ubuntu-latest, macos-latest]
scala: [2.12.19]
java: [temurin@8, temurin@11, temurin@17, temurin@21]
exclude:
- java: temurin@8
os: macos-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
Expand Down Expand Up @@ -64,6 +67,10 @@ jobs:
java-version: 21
cache: sbt

- name: Install sbt
if: matrix.os == 'macos-latest'
run: brew install sbt

- name: Setup git
run: |
git config --global init.defaultBranch main
Expand Down
18 changes: 16 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ ThisBuild / githubWorkflowPublish := Seq(
)
)

ThisBuild / githubWorkflowOSes := Seq("ubuntu-latest", "macos-12")
ThisBuild / githubWorkflowOSes := Seq("ubuntu-latest", "macos-latest")

ThisBuild / githubWorkflowJavaVersions := Seq(
JavaSpec.temurin("8"),
Expand All @@ -95,8 +95,22 @@ ThisBuild / githubWorkflowJavaVersions := Seq(
JavaSpec.temurin("21")
)

ThisBuild / githubWorkflowBuildMatrixExclusions +=
MatrixExclude(Map("java" -> "temurin@8", "os" -> "macos-latest"))

// GitHub Actions macOS 13+ runner images do not come with sbt preinstalled anymore
ThisBuild / githubWorkflowBuildPreamble ++= Seq(
WorkflowStep.Run(
commands = List(
"brew install sbt"
),
cond = Some("matrix.os == 'macos-latest'"),
name = Some("Install sbt")
)
)

// Necessary to setup git so that sbt-scripted tests can run on github actions
ThisBuild / githubWorkflowBuildPreamble := Seq(
ThisBuild / githubWorkflowBuildPreamble ++= Seq(
WorkflowStep.Run(
commands = List(
"git config --global init.defaultBranch main",
Expand Down

0 comments on commit 6f2f4b5

Please sign in to comment.