From 0c4e833d0c860bd74a288bbd9322e76f8ae995a2 Mon Sep 17 00:00:00 2001 From: Milad Khajavi Date: Fri, 20 Dec 2024 15:07:20 +0330 Subject: [PATCH] initial work. --- .github/workflows/ci.yml | 12 ++++++++++++ project/plugins.sbt | 2 +- zio-sbt-ci/build.sbt | 2 +- zio-sbt-ci/src/main/scala/zio/sbt/V.scala | 3 ++- .../src/main/scala/zio/sbt/ZioSbtCiPlugin.scala | 16 +++++++++++++++- zio-sbt-ecosystem/build.sbt | 2 +- zio-sbt-githubactions/build.sbt | 2 +- zio-sbt-website/build.sbt | 2 +- 8 files changed, 34 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b177da0f..aa19d016 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 @@ -216,6 +226,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: Setup NodeJs diff --git a/project/plugins.sbt b/project/plugins.sbt index b9292898..c22c5c13 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -27,4 +27,4 @@ addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.7") libraryDependencies += "org.snakeyaml" % "snakeyaml-engine" % "2.7" libraryDependencies += "dev.zio" %% "zio" % "2.1.8" -libraryDependencies += "io.circe" %% "circe-yaml" % "0.16.0" +libraryDependencies += "io.circe" %% "circe-yaml" % "0.15.2" diff --git a/zio-sbt-ci/build.sbt b/zio-sbt-ci/build.sbt index b7d36a60..6005a138 100644 --- a/zio-sbt-ci/build.sbt +++ b/zio-sbt-ci/build.sbt @@ -1,2 +1,2 @@ libraryDependencies += "dev.zio" %% "zio" % "2.1.8" -libraryDependencies += "io.circe" %% "circe-yaml" % "0.16.0" +libraryDependencies += "io.circe" %% "circe-yaml" % "0.15.2" 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 d123c12a..0ba16de0 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 70371ac6..7bd57e69 100644 --- a/zio-sbt-ci/src/main/scala/zio/sbt/ZioSbtCiPlugin.scala +++ b/zio-sbt-ci/src/main/scala/zio/sbt/ZioSbtCiPlugin.scala @@ -110,6 +110,7 @@ object ZioSbtCiPlugin extends AutoPlugin { checkout, SetupLibuv, SetupJava(javaVersion), + SetupSBT, CacheDependencies ) ++ checkAllCodeCompiles ++ checkArtifactBuildProcess ++ checkWebsiteBuildProcess } @@ -130,7 +131,9 @@ object ZioSbtCiPlugin extends AutoPlugin { id = "lint", name = "Lint", steps = (if (swapSizeGB > 0) Seq(setSwapSpace) else Seq.empty) ++ - Seq(checkout, SetupLibuv, SetupJava(javaVersion), CacheDependencies) ++ checkGithubWorkflow ++ Seq(lint) + Seq(checkout, SetupLibuv, SetupJava(javaVersion), SetupSBT, CacheDependencies) ++ checkGithubWorkflow ++ Seq( + lint + ) ) ) } @@ -171,6 +174,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) { @@ -251,6 +255,7 @@ object ZioSbtCiPlugin extends AutoPlugin { Seq( SetupLibuv, SetupJava("${{ matrix.java }}"), + SetupSBT, CacheDependencies, checkout, if (javaPlatformMatrix.values.toSet.isEmpty) { @@ -304,6 +309,7 @@ object ZioSbtCiPlugin extends AutoPlugin { Seq( SetupLibuv, SetupJava("${{ matrix.java }}"), + SetupSBT, CacheDependencies, checkout, Step.SingleStep( @@ -355,6 +361,7 @@ object ZioSbtCiPlugin extends AutoPlugin { checkout, SetupLibuv, SetupJava(javaVersion), + SetupSBT, CacheDependencies, generateReadme, Step.SingleStep( @@ -434,6 +441,7 @@ object ZioSbtCiPlugin extends AutoPlugin { checkout, SetupLibuv, SetupJava(javaVersion), + SetupSBT, CacheDependencies, release ) @@ -466,6 +474,7 @@ object ZioSbtCiPlugin extends AutoPlugin { checkout, SetupLibuv, SetupJava(javaVersion), + SetupSBT, CacheDependencies, SetupNodeJs, publishToNpmRegistry @@ -669,6 +678,11 @@ object ZioSbtCiPlugin extends AutoPlugin { ) ) + lazy 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"))) diff --git a/zio-sbt-ecosystem/build.sbt b/zio-sbt-ecosystem/build.sbt index c673cdb8..ee47bfa6 100644 --- a/zio-sbt-ecosystem/build.sbt +++ b/zio-sbt-ecosystem/build.sbt @@ -31,4 +31,4 @@ addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.3") libraryDependencies += "org.snakeyaml" % "snakeyaml-engine" % "2.7" libraryDependencies += "dev.zio" %% "zio" % "2.1.8" -libraryDependencies += "io.circe" %% "circe-yaml" % "0.16.0" +libraryDependencies += "io.circe" %% "circe-yaml" % "0.15.2" diff --git a/zio-sbt-githubactions/build.sbt b/zio-sbt-githubactions/build.sbt index b7d36a60..6005a138 100644 --- a/zio-sbt-githubactions/build.sbt +++ b/zio-sbt-githubactions/build.sbt @@ -1,2 +1,2 @@ libraryDependencies += "dev.zio" %% "zio" % "2.1.8" -libraryDependencies += "io.circe" %% "circe-yaml" % "0.16.0" +libraryDependencies += "io.circe" %% "circe-yaml" % "0.15.2" diff --git a/zio-sbt-website/build.sbt b/zio-sbt-website/build.sbt index f45bd37d..a1e96dd2 100644 --- a/zio-sbt-website/build.sbt +++ b/zio-sbt-website/build.sbt @@ -3,4 +3,4 @@ addSbtPlugin("com.github.sbt" % "sbt-unidoc" % "0.5.0") addSbtPlugin("com.thoughtworks.sbt-api-mappings" % "sbt-api-mappings" % "3.0.2") libraryDependencies += "dev.zio" %% "zio" % "2.1.8" -libraryDependencies += "io.circe" %% "circe-yaml" % "0.16.0" +libraryDependencies += "io.circe" %% "circe-yaml" % "0.15.2"