Skip to content

Commit

Permalink
add setup-sbt
Browse files Browse the repository at this point in the history
  • Loading branch information
ThijsBroersen committed Dec 12, 2024
1 parent 223d0f2 commit e7dec54
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion zio-sbt-ci/src/main/scala/zio/sbt/V.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
14 changes: 13 additions & 1 deletion zio-sbt-ci/src/main/scala/zio/sbt/ZioSbtCiPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ object ZioSbtCiPlugin extends AutoPlugin {
checkout,
SetupLibuv,
SetupJava(javaVersion),
SetupSbt,
CacheDependencies
) ++ checkAllCodeCompiles ++ checkArtifactBuildProcess ++ checkWebsiteBuildProcess
}
Expand All @@ -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)
)
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -249,6 +252,7 @@ object ZioSbtCiPlugin extends AutoPlugin {
Seq(
SetupLibuv,
SetupJava("${{ matrix.java }}"),
SetupSbt,
CacheDependencies,
checkout
) ++ (
Expand Down Expand Up @@ -303,6 +307,7 @@ object ZioSbtCiPlugin extends AutoPlugin {
Seq(
SetupLibuv,
SetupJava("${{ matrix.java }}"),
SetupSbt,
CacheDependencies,
checkout,
Step.SingleStep(
Expand Down Expand Up @@ -352,6 +357,7 @@ object ZioSbtCiPlugin extends AutoPlugin {
checkout,
SetupLibuv,
SetupJava(javaVersion),
SetupSbt,
CacheDependencies,
generateReadme,
Step.SingleStep(
Expand Down Expand Up @@ -438,6 +444,7 @@ object ZioSbtCiPlugin extends AutoPlugin {
checkout,
SetupLibuv,
SetupJava(javaVersion),
SetupSbt,
CacheDependencies,
release
)
Expand Down Expand Up @@ -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")))
Expand Down

0 comments on commit e7dec54

Please sign in to comment.