From e7dec54f228a55e1136b95235154e5fcf4948c85 Mon Sep 17 00:00:00 2001 From: Thijs Broersen Date: Thu, 12 Dec 2024 16:07:44 +0100 Subject: [PATCH] add setup-sbt --- .github/workflows/ci.yml | 10 ++++++++++ zio-sbt-ci/src/main/scala/zio/sbt/V.scala | 3 ++- .../src/main/scala/zio/sbt/ZioSbtCiPlugin.scala | 14 +++++++++++++- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8cf9a0a4..0f898f29 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,6 +36,8 @@ jobs: distribution: corretto java-version: '17' check-latest: true + - name: Setup SBT + uses: sbt/setup-sbt@v1 - name: Cache Dependencies uses: coursier/cache-action@v6 - name: Check all code compiles @@ -61,6 +63,8 @@ jobs: distribution: corretto java-version: '17' check-latest: true + - name: Setup SBT + uses: sbt/setup-sbt@v1 - name: Cache Dependencies uses: coursier/cache-action@v6 - name: Check if the site workflow is up to date @@ -87,6 +91,8 @@ jobs: distribution: corretto java-version: ${{ matrix.java }} check-latest: true + - name: Setup SBT + uses: sbt/setup-sbt@v1 - name: Cache Dependencies uses: coursier/cache-action@v6 - name: Git Checkout @@ -113,6 +119,8 @@ jobs: distribution: corretto java-version: '17' check-latest: true + - name: Setup SBT + uses: sbt/setup-sbt@v1 - name: Cache Dependencies uses: coursier/cache-action@v6 - name: Generate Readme @@ -187,6 +195,8 @@ jobs: distribution: corretto java-version: '17' check-latest: true + - name: Setup SBT + uses: sbt/setup-sbt@v1 - name: Cache Dependencies uses: coursier/cache-action@v6 - name: Release diff --git a/zio-sbt-ci/src/main/scala/zio/sbt/V.scala b/zio-sbt-ci/src/main/scala/zio/sbt/V.scala index f71e1f18..770fd1a9 100644 --- a/zio-sbt-ci/src/main/scala/zio/sbt/V.scala +++ b/zio-sbt-ci/src/main/scala/zio/sbt/V.scala @@ -9,6 +9,7 @@ object V { "actions/checkout" -> "v4", "coursier/cache-action" -> "v6", "actions/setup-java" -> "v4", - "actions/setup-node" -> "v4" + "actions/setup-node" -> "v4", + "sbt/setup-sbt" -> "v1" ).map { case (k, v) => (k, s"$k@$v") }.apply(packageName) } diff --git a/zio-sbt-ci/src/main/scala/zio/sbt/ZioSbtCiPlugin.scala b/zio-sbt-ci/src/main/scala/zio/sbt/ZioSbtCiPlugin.scala index 6968a010..82ae8781 100644 --- a/zio-sbt-ci/src/main/scala/zio/sbt/ZioSbtCiPlugin.scala +++ b/zio-sbt-ci/src/main/scala/zio/sbt/ZioSbtCiPlugin.scala @@ -109,6 +109,7 @@ object ZioSbtCiPlugin extends AutoPlugin { checkout, SetupLibuv, SetupJava(javaVersion), + SetupSbt, CacheDependencies ) ++ checkAllCodeCompiles ++ checkArtifactBuildProcess ++ checkWebsiteBuildProcess } @@ -128,7 +129,8 @@ object ZioSbtCiPlugin extends AutoPlugin { Job( name = "Lint", steps = (if (swapSizeGB > 0) Seq(setSwapSpace) else Seq.empty) ++ - Seq(checkout, SetupLibuv, SetupJava(javaVersion), CacheDependencies) ++ checkGithubWorkflow.flatMap( + Seq(checkout, SetupLibuv, SetupJava(javaVersion), SetupSbt, CacheDependencies) ++ + checkGithubWorkflow.flatMap( _.flatten ) ++ Seq(lint) ) @@ -170,6 +172,7 @@ object ZioSbtCiPlugin extends AutoPlugin { (if (swapSizeGB > 0) Seq(setSwapSpace) else Seq.empty) ++ Seq( SetupLibuv, SetupJava("${{ matrix.java }}"), + SetupSbt, CacheDependencies, checkout ) ++ (if (javaPlatformMatrix.values.toSet.isEmpty) { @@ -249,6 +252,7 @@ object ZioSbtCiPlugin extends AutoPlugin { Seq( SetupLibuv, SetupJava("${{ matrix.java }}"), + SetupSbt, CacheDependencies, checkout ) ++ ( @@ -303,6 +307,7 @@ object ZioSbtCiPlugin extends AutoPlugin { Seq( SetupLibuv, SetupJava("${{ matrix.java }}"), + SetupSbt, CacheDependencies, checkout, Step.SingleStep( @@ -352,6 +357,7 @@ object ZioSbtCiPlugin extends AutoPlugin { checkout, SetupLibuv, SetupJava(javaVersion), + SetupSbt, CacheDependencies, generateReadme, Step.SingleStep( @@ -438,6 +444,7 @@ object ZioSbtCiPlugin extends AutoPlugin { checkout, SetupLibuv, SetupJava(javaVersion), + SetupSbt, CacheDependencies, release ) @@ -675,6 +682,11 @@ object ZioSbtCiPlugin extends AutoPlugin { ) ) + val SetupSbt: Step.SingleStep = Step.SingleStep( + name = "Setup SBT", + uses = Some(ActionRef(V("sbt/setup-sbt"))) + ) + lazy val CacheDependencies: Step.SingleStep = Step.SingleStep( name = "Cache Dependencies", uses = Some(ActionRef(V("coursier/cache-action")))