From 8a2da7109cc684783c69042234c8aa673535753f Mon Sep 17 00:00:00 2001 From: Matthias Kurz Date: Mon, 13 May 2024 12:35:44 +0200 Subject: [PATCH 1/2] Use macos-latest (macOS 14 Arm) which does not provide Java 8 --- .github/workflows/ci.yml | 5 ++++- build.sbt | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 687632d..459b99c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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) diff --git a/build.sbt b/build.sbt index d807486..c3ae705 100644 --- a/build.sbt +++ b/build.sbt @@ -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"), @@ -95,6 +95,9 @@ ThisBuild / githubWorkflowJavaVersions := Seq( JavaSpec.temurin("21") ) +ThisBuild / githubWorkflowBuildMatrixExclusions += + MatrixExclude(Map("java" -> "temurin@8", "os" -> "macos-latest")) + // Necessary to setup git so that sbt-scripted tests can run on github actions ThisBuild / githubWorkflowBuildPreamble := Seq( WorkflowStep.Run( From 17b2b26d8da8bf693ef1c1cc52789302356c1700 Mon Sep 17 00:00:00 2001 From: Matthias Kurz Date: Mon, 13 May 2024 13:49:39 +0200 Subject: [PATCH 2/2] "brew install sbt" necessary with macos-latest now --- .github/workflows/ci.yml | 4 ++++ build.sbt | 13 ++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 459b99c..9182506 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,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 diff --git a/build.sbt b/build.sbt index c3ae705..5f3f7a1 100644 --- a/build.sbt +++ b/build.sbt @@ -98,8 +98,19 @@ ThisBuild / githubWorkflowJavaVersions := Seq( 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",