Skip to content

Commit

Permalink
add default strategy for testing modules when ciTargetScalaVersions i…
Browse files Browse the repository at this point in the history
…s empty.
  • Loading branch information
khajavi committed Apr 11, 2023
1 parent 40d9a00 commit c57e764
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 16 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,6 @@ jobs:
- '8'
- '11'
- '17'
scala-project:
- ++2.12.17 zio-sbt-website
- ++2.12.17 zio-sbt-ecosystem
- ++2.12.17 zio-sbt-ci
- ++2.12.17 zio-sbt-tests
steps:
- name: Install libuv
run: sudo apt-get update && sudo apt-get install -y libuv1-dev
Expand All @@ -94,7 +89,7 @@ jobs:
with:
fetch-depth: '0'
- name: Test
run: sbt ${{ matrix.scala-project }}/test
run: sbt ++test
update-readme:
name: Update README
runs-on: ubuntu-latest
Expand Down
9 changes: 1 addition & 8 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,7 @@ inThisBuild(
developers := List(
Developer("khajavi", "Milad Khajavi", "khajavi@gmail.com", url("https://github.com/khajavi"))
),
ciEnabledBranches := Seq("main"),
// ciTargetScalaVersions :=
// targetScalaVersionsFor(
// `zio-sbt-website`,
// `zio-sbt-ecosystem`,
// `zio-sbt-ci`,
// `zio-sbt-tests`
// ).value,
ciEnabledBranches := Seq("main"),
ciCheckGithubWorkflowSteps := Seq.empty
)
)
Expand Down
2 changes: 1 addition & 1 deletion zio-sbt-ci/src/main/scala/zio/sbt/V.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ object V {
"actions/setup-java" -> "v3.10.0",
"coursier/cache-action" -> "v6",
"actions/setup-node" -> "v3"
)(packageName)
).map { case (k, v) => (k, s"$k@$v") }.apply(packageName)
}
29 changes: 28 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 @@ -291,7 +291,34 @@ object ZioSbtCiPlugin extends AutoPlugin {
) ++ extraTestSteps
)

Seq(if (groupSimilarTests) GroupTests else FlattenTests)
val DefaultTestStrategy =
Job(
id = "test",
name = "Test",
strategy = Some(
Strategy(
matrix = Map("java" -> javaPlatforms.toList),
maxParallel = matrixMaxParallel,
failFast = false
)
),
steps = (if (swapSizeGB > 0) Seq(setSwapSpace) else Seq.empty) ++
Seq(
SetupLibuv,
SetupJava("${{ matrix.java }}"),
CacheDependencies,
checkout,
Step.SingleStep(
name = "Test",
run = Some(prefixJobs + "sbt ++test")
)
) ++ extraTestSteps
)

if (javaPlatformMatrix.isEmpty && scalaVersionMatrix.isEmpty)
Seq(DefaultTestStrategy)
else
Seq(if (groupSimilarTests) GroupTests else FlattenTests)
}

lazy val reportSuccessfulJobs: Def.Initialize[Seq[Job]] = Def.setting {
Expand Down

0 comments on commit c57e764

Please # to comment.