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
56 changes: 22 additions & 34 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
matrix:
os: [ubuntu-22.04]
scala: [2.13, 3]
java: [temurin@11, temurin@25]
java: [temurin@17, temurin@25]
project: [rootJS, rootJVM, rootNative]
exclude:
- project: rootJS
Expand All @@ -47,17 +47,17 @@ jobs:
- name: Setup sbt
uses: sbt/setup-sbt@v1

- name: Setup Java (temurin@11)
id: setup-java-temurin-11
if: matrix.java == 'temurin@11'
- name: Setup Java (temurin@17)
id: setup-java-temurin-17
if: matrix.java == 'temurin@17'
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 11
java-version: 17
cache: sbt

- name: sbt update
if: matrix.java == 'temurin@11' && steps.setup-java-temurin-11.outputs.cache-hit == 'false'
if: matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false'
run: sbt +update

- name: Setup Java (temurin@25)
Expand All @@ -77,7 +77,7 @@ jobs:
run: sbt githubWorkflowCheck

- name: Check formatting
if: matrix.java == 'temurin@11' && matrix.os == 'ubuntu-22.04'
if: matrix.java == 'temurin@17' && matrix.os == 'ubuntu-22.04'
run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' scalafmtCheckAll 'project /' scalafmtSbtCheck

- name: scalaJSLink
Expand All @@ -92,29 +92,17 @@ jobs:
run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' test

- name: Check binary compatibility
if: matrix.java == 'temurin@11' && matrix.os == 'ubuntu-22.04'
if: matrix.java == 'temurin@17' && matrix.os == 'ubuntu-22.04'
run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' mimaReportBinaryIssues

- name: Generate API documentation
if: matrix.java == 'temurin@11' && matrix.os == 'ubuntu-22.04'
if: matrix.java == 'temurin@17' && matrix.os == 'ubuntu-22.04'
run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' doc

- name: Run documentation
if: matrix.scala == '2.13' && matrix.project == 'rootJVM'
run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' docs/mdoc

- name: Run Scala Next Tests (jvm)
if: matrix.java == 'temurin@25' && matrix.scala == '3'
run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' scalaNextTestJVM/test

- name: Run Scala Next Tests (js)
if: matrix.java == 'temurin@25' && matrix.scala == '3'
run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' scalaNextTestJS/test

- name: Run Scala Next Tests (native)
if: matrix.java == 'temurin@25' && matrix.scala == '3'
run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' scalaNextTestNative/test

- name: Make target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v'))
run: mkdir -p unsafe/.js/target generic/.jvm/target law/.js/target macro/.jvm/target unsafe/.native/target state/.jvm/target core/native/target unsafe/.jvm/target macro/.native/target core/js/target macro/.js/target law/.jvm/target generic/.js/target core/jvm/target refined/.native/target law/.native/target refined/.js/target refined/.jvm/target state/.native/target state/.js/target generic/.native/target project/target
Expand All @@ -137,7 +125,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-22.04]
java: [temurin@11]
java: [temurin@17]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
Expand All @@ -148,17 +136,17 @@ jobs:
- name: Setup sbt
uses: sbt/setup-sbt@v1

- name: Setup Java (temurin@11)
id: setup-java-temurin-11
if: matrix.java == 'temurin@11'
- name: Setup Java (temurin@17)
id: setup-java-temurin-17
if: matrix.java == 'temurin@17'
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 11
java-version: 17
cache: sbt

- name: sbt update
if: matrix.java == 'temurin@11' && steps.setup-java-temurin-11.outputs.cache-hit == 'false'
if: matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false'
run: sbt +update

- name: Setup Java (temurin@25)
Expand Down Expand Up @@ -269,7 +257,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-22.04]
java: [temurin@11]
java: [temurin@17]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
Expand All @@ -280,17 +268,17 @@ jobs:
- name: Setup sbt
uses: sbt/setup-sbt@v1

- name: Setup Java (temurin@11)
id: setup-java-temurin-11
if: matrix.java == 'temurin@11'
- name: Setup Java (temurin@17)
id: setup-java-temurin-17
if: matrix.java == 'temurin@17'
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 11
java-version: 17
cache: sbt

- name: sbt update
if: matrix.java == 'temurin@11' && steps.setup-java-temurin-11.outputs.cache-hit == 'false'
if: matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false'
run: sbt +update

- name: Setup Java (temurin@25)
Expand All @@ -309,7 +297,7 @@ jobs:
- name: Submit Dependencies
uses: scalacenter/sbt-dependency-submission@v2
with:
modules-ignore: monocle-test_2.13 monocle-test_3 monocle-test_native0.5_2.13 monocle-test_native0.5_3 rootjs_2.13 rootjs_3 monocle-docs_2.13 scalanexttest_3 rootjvm_2.13 rootjvm_3 rootnative_2.13 rootnative_3 scalanexttest_native0.5_3 scalanexttest_sjs1_3 monocle-test_sjs1_2.13 monocle-test_sjs1_3 monocle-example_2.13 monocle-example_3 monocle-bench_2.13 monocle-bench_3
modules-ignore: monocle-test_2.13 monocle-test_3 monocle-test_native0.5_2.13 monocle-test_native0.5_3 rootjs_2.13 rootjs_3 monocle-docs_2.13 rootjvm_2.13 rootjvm_3 rootnative_2.13 rootnative_3 monocle-test_sjs1_2.13 monocle-test_sjs1_3 monocle-example_2.13 monocle-example_3 monocle-bench_2.13 monocle-bench_3
configs-ignore: test scala-tool scala-doc-tool test-internal

validate-steward:
Expand Down
53 changes: 13 additions & 40 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,9 @@ inThisBuild(
name = Some("Run documentation"),
cond = Some(s"matrix.scala == '2.13' && matrix.project == 'rootJVM'")
)
) ++ scalaNextTest.projects.map { case (platform, project) =>
WorkflowStep.Sbt(
List(s"${project.id}/test"),
name = Some(s"Run Scala Next Tests (${platform.identifier})"),
cond = Some(s"matrix.java == 'temurin@25' && matrix.scala == '3'")
)
},
),
githubWorkflowJavaVersions := Seq(
JavaSpec.temurin("11"),
JavaSpec.temurin("17"),
JavaSpec.temurin("25")
),
githubWorkflowPublishPostamble += WorkflowStep.Sbt(
Expand Down Expand Up @@ -113,10 +107,9 @@ lazy val buildSettings = Seq(
}
)

lazy val catsVersion = "2.13.0"
lazy val scala2Version = "2.13.18"
lazy val scala3Version = "3.3.8"
lazy val scalaNextVersion = "3.8.4"
lazy val catsVersion = "2.13.0"
lazy val scala2Version = "2.13.18"
lazy val scala3Version = "3.9.0"

lazy val cats = Def.setting("org.typelevel" %%% "cats-core" % catsVersion)
lazy val catsFree = Def.setting("org.typelevel" %%% "cats-free" % catsVersion)
Expand All @@ -142,29 +135,21 @@ lazy val scalaNativeSettings = Seq(
)

lazy val defaultReleaseOption = "-release:8"
lazy val scala3ReleaseOption = "-release:17"

lazy val releaseOption = Def.setting {
if (scalaBinaryVersion.value == "3") scala3ReleaseOption else defaultReleaseOption
}

lazy val monocleSettings = buildSettings
lazy val monocleJvmSettings = monocleSettings ++ Seq(
scalacOptions ++= {
if (scalaVersion.value.startsWith("3.3.")) {
Seq(
"-Yfuture-lazy-vals",
"-release:11"
)
} else if (scalaBinaryVersion.value == "3") {
Nil
} else {
Seq(
defaultReleaseOption
)
}
}
scalacOptions += releaseOption.value
)
lazy val monocleJsSettings = monocleSettings ++ scalajsSettings ++ Seq(
scalacOptions += defaultReleaseOption
scalacOptions += releaseOption.value
)
lazy val monocleNativeSettings = monocleSettings ++ scalaNativeSettings ++ Seq(
scalacOptions += defaultReleaseOption
scalacOptions += releaseOption.value
)

lazy val root = tlCrossRootProject.aggregate(
Expand Down Expand Up @@ -312,18 +297,6 @@ lazy val test = crossProject(JVMPlatform, JSPlatform, NativePlatform)
)
)

lazy val scalaNextTest = crossProject(JVMPlatform, JSPlatform, NativePlatform)
.dependsOn(test % "test->test")
.jvmSettings(monocleJvmSettings)
.jsSettings(monocleJsSettings)
.nativeSettings(monocleNativeSettings)
.enablePlugins(NoPublishPlugin)
.settings(
crossScalaVersions := Seq(scalaNextVersion),
libraryDependencies ++= Seq(munitDiscipline.value),
scalacOptions --= Seq("-release:8", "-Ykind-projector")
)

lazy val bench = project
.dependsOn(core.jvm, generic.jvm, macros.jvm)
.settings(moduleName := "monocle-bench")
Expand Down
Loading