Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ jobs:
scala-version: [ "2.12", "2.13", "3" ]
target-platform: [ "JVM", "JS", "Native" ]
java: [ "11", "21" ]
exclude:
- java: "21"
include: # Restricted to build only specific Loom-based modules
- scala-version: "3"
target-platform: "JVM"
java: "21"
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -50,8 +44,11 @@ jobs:
uses: VirtusLab/scala-cli-setup@77834b5926f3eb70869d8009530c65585f7a039b # main, specifically v1.9.1
with:
jvm: '' # needed because scala-cli-setup otherwise forces the installation of their default JVM (17)
- name: Enable Loom-specific modules
- name: Enable ZIO-specific modules
if: matrix.java == '21'
run: echo "WITH_ZIO=1" >> $GITHUB_ENV
- name: Enable Loom-specific modules
if: matrix.target-platform == 'JVM' && matrix.java == '21' && matrix.scala-version == '3'
Copy link
Contributor Author

@mijicd mijicd Feb 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this excludes zio project, but it resembles the old behavior where no modules but loom ones are tested/published for this particular build point (3, JVM, 21). We can adjust this if necessary (e.g. using ALSO_LOOM?).

run: echo "ONLY_LOOM=1" >> $GITHUB_ENV
- name: Compile
run: sbt -v "compileScoped ${{ matrix.scala-version }} ${{ matrix.target-platform }}"
Expand Down Expand Up @@ -100,10 +97,13 @@ jobs:
sudo apt-get update
sudo apt-get install libidn2-dev libcurl3-dev
- name: Enable Native-specific modules
if: matrix.java == '11'
if: matrix.target-platform == 'Native'
run: echo "STTP_NATIVE=1" >> $GITHUB_ENV
- name: Enable Loom-specific modules
- name: Enable ZIO-specific modules
if: matrix.java == '21'
run: echo "WITH_ZIO=1" >> $GITHUB_ENV
- name: Enable Loom-specific modules
if: matrix.target-platform == 'JVM' && matrix.java == '21' && matrix.scala-version == '3'
run: echo "ONLY_LOOM=1" >> $GITHUB_ENV
- name: Compile
run: sbt compile
Expand Down
21 changes: 16 additions & 5 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ val slf4jVersion = "1.7.36"

val compileAndTest = "compile->compile;test->test"

lazy val loomProjects: Seq[String] = Seq(ox, examples).flatMap(_.projectRefs).flatMap(projectId)
lazy val loomProjects: Seq[String] = Seq(ox, examples, zioJson).flatMap(_.projectRefs).flatMap(projectId)
lazy val zioProjects: Seq[String] = Seq(zioJson).flatMap(_.projectRefs).flatMap(projectId)
Copy link
Contributor Author

@mijicd mijicd Feb 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that zio1Json is still around, but it is heavily deprecated, therefore, I did not include it here. I would propose removing it at one point.


def projectId(projectRef: ProjectReference): Option[String] =
projectRef match {
Expand All @@ -193,15 +194,24 @@ lazy val allAggregates: Seq[ProjectReference] = {
println("[info] STTP_NATIVE *not* defined, *not* including native in the aggregate projects")
rawAllAggregates.filterNot(_.toString.contains("Native"))
}

val filteredByZio = if (sys.env.isDefinedAt("WITH_ZIO")) {
println("[info] WITH_ZIO defined, including zio projects in the aggregate projects")
filteredByNative
} else {
println("[info] WITH_ZIO *not* defined, *not* including zio-json in the aggregate projects")
filteredByNative.filterNot(p => projectId(p).forall(zioProjects.contains))
}

if (sys.env.isDefinedAt("ONLY_LOOM")) {
println("[info] ONLY_LOOM defined, including only loom-based projects")
filteredByNative.filter(p => projectId(p).forall(loomProjects.contains))
filteredByZio.filter(p => projectId(p).forall(loomProjects.contains))
} else if (sys.env.isDefinedAt("ALSO_LOOM")) {
println("[info] ALSO_LOOM defined, including also loom-based projects")
filteredByNative
filteredByZio
} else {
println("[info] ONLY_LOOM *not* defined, *not* including loom-based-projects")
filteredByNative.filterNot(p => projectId(p).forall(loomProjects.contains))
filteredByZio.filterNot(p => projectId(p).forall(loomProjects.contains))
}
}

Expand Down Expand Up @@ -789,7 +799,7 @@ lazy val zioJson = (projectMatrix in file("json/zio-json"))
.settings(
name := "zio-json",
libraryDependencies ++= Seq(
"dev.zio" %%% "zio-json" % "0.7.44",
"dev.zio" %%% "zio-json" % "0.9.0",
"com.softwaremill.sttp.shared" %%% "zio" % sttpSharedVersion
),
scalaTest
Expand All @@ -799,6 +809,7 @@ lazy val zioJson = (projectMatrix in file("json/zio-json"))
settings = commonJvmSettings
)
.jsPlatform(scalaVersions = scala2And3, settings = commonJsSettings)
.nativePlatform(scalaVersions = scala2And3, settings = commonNativeSettings)
.dependsOn(core, jsonCommon % compileAndTest)

lazy val zio1Json = (projectMatrix in file("json/zio1-json"))
Expand Down
Loading