Skip to content

Commit

Permalink
Update to ZIO 2.0.22 and latest Scala LTS + maintenance versions (#690)
Browse files Browse the repository at this point in the history
* Update Cats Effect and FS2

- Update Cats Effect to 3.5.3
- Update FS2 to 3.9.4 and use updated APIs

* Update to ZIO 2.0.22 and latest Scala LTS + maintenance versions and fix all Xsource errors

* Update GitHub Action Scala builds
  • Loading branch information
calvinlfer authored Apr 12, 2024
1 parent 79a853c commit 772233b
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 22 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
fail-fast: false
matrix:
java: ['[email protected]', '[email protected]']
scala: ['2.12.17', '2.13.10', '3.3.0']
scala: ['2.12.19', '2.13.13', '3.3.3']
platform: ['JVM', 'JS']
steps:
- name: Checkout current branch
Expand All @@ -45,10 +45,10 @@ jobs:
- name: Cache scala dependencies
uses: coursier/cache-action@v5
- name: Run tests
if: matrix.scala != '3.3.0'
if: matrix.scala != '3.3.3'
run: sbt ++${{ matrix.scala }}! test${{ matrix.platform }}
- name: Run dotty tests
if: matrix.scala == '3.3.0' && matrix.platform == 'JVM'
if: matrix.scala == '3.3.3' && matrix.platform == 'JVM'
run: sbt ++${{ matrix.scala }}! testJVM

ci:
Expand Down
6 changes: 3 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ lazy val root = project
unusedCompileDependenciesFilter -= moduleFilter("org.scala-js", "scalajs-library")
)

val zioVersion = "2.0.21"
val zioVersion = "2.0.22"
val catsVersion = "2.9.0"
val catsEffectVersion = "3.5.3"
val catsEffectVersion = "3.5.4"
val catsMtlVersion = "1.3.0"
val disciplineScalaTestVersion = "2.2.0"
val fs2Version = "3.9.4"
val fs2Version = "3.10.2"
val scalaJavaTimeVersion = "2.5.0"

lazy val zioInteropTracer = crossProject(JSPlatform, JVMPlatform)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import zio.stream.{ Stream, ZStream }
import zio.test.*

object CoreSummonSpec extends ZIOSpecDefault {
override def spec =
override def spec: Spec[Any, Throwable] =
suite("summons from catz.core work with only a cats-core dependency")(
test("ZIO instances") {
val monad = implicitly[Monad[UIO]]
Expand Down
8 changes: 4 additions & 4 deletions project/BuildHelper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import BuildInfoKeys._
object BuildHelper {
val testDeps = Seq("org.scalacheck" %% "scalacheck" % "1.17.0" % Test)

val Scala212 = "2.12.17"
val Scala213 = "2.13.10"
val Scala3 = "3.3.0"
val Scala212 = "2.12.19"
val Scala213 = "2.13.13"
val Scala3 = "3.3.3"

private val stdOptions = Seq(
"-deprecation",
Expand Down Expand Up @@ -92,7 +92,7 @@ object BuildHelper {
scalacOptions ++= stdOptions ++ extraOptions(scalaVersion.value, optimize = !isSnapshot.value),
libraryDependencies ++= testDeps ++ {
if (isDotty(scalaVersion.value)) Seq.empty
else Seq(compilerPlugin("org.typelevel" % "kind-projector" % "0.13.2") cross CrossVersion.full)
else Seq(compilerPlugin("org.typelevel" % "kind-projector" % "0.13.3") cross CrossVersion.full)
},
Test / parallelExecution := true,
incOptions ~= (_.withLogRecompileOnMacro(false)),
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.8.2
sbt.version=1.9.9
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import zio.Trace

object InteropTracerSpec extends ZIOSpecDefault {

private val myLambda: () => Any = () => ()
override def spec =
private val myLambda: () => Any = () => ()
override def spec: Spec[Any, Throwable] =
suite("InteropTracerSpec")(
test("lambda tracing") {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import zio.test.*
import zio.*

object CatsInteropSpec extends CatsRunnableSpec {
def spec = suite("Cats interop")(
def spec: Spec[Any, Throwable] = suite("Cats interop")(
test("cats fiber wrapped in Resource can be canceled") {
for {
promise <- Promise.make[Nothing, Int]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import scala.collection.mutable

object CatsZManagedSyntaxSpec extends CatsRunnableSpec {

def spec =
def spec: Spec[Any, Throwable] =
suite("CatsZManagedSyntaxSpec")(
suite("toManaged")(
test("calls finalizers correctly when use is externally interrupted") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import zio.test.*
import zio.test.interop.catz.test.*

object Fs2ZioSpec extends CatsRunnableSpec {
def spec =
def spec: Spec[Any, Throwable] =
suite("ZIO with Fs2")(
suite("fs2 parJoin")(
testF("works if F is cats.effect.IO") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ object catzQueueSpec extends CatsRunnableSpec {
actual <- q.takeAll
} yield assert(actual)(equalTo(expected.toList))

def spec = suite("catzQueueSpec")(
def spec: Spec[Any, Throwable] = suite("catzQueueSpec")(
testF("can use a bounded queue from Cats Effect IO")(boundedQueueTest[CIO]),
testF("can use a dropping queue from Cats Effect IO")(droppingQueueTest[CIO]),
testF("can use a sliding queue from Cats Effect IO")(slidingQueueTest[CIO]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ object fs2StreamSpec extends ZIOSpecDefault {
y <- expected.runCollect
} yield assert(x)(equalTo(y))

def spec = suite("zio.stream.ZStream <-> fs2.Stream")(
def spec: Spec[Any, Throwable] = suite("zio.stream.ZStream <-> fs2.Stream")(
suite("test toFs2Stream conversion")(
test("simple stream")(check(Gen.chunkOf(Gen.int)) { (chunk: Chunk[Int]) =>
assertEqual(ZStream.fromChunk(chunk).toFs2Stream, fs2StreamFromChunk(chunk))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ abstract class CatsRunnableSpec extends ZIOSpecDefault {
Unsafe.unsafe { implicit u =>
runtime.unsafe.runToFuture {
ZIO.fromFuture { implicit ec =>
Dispatcher.parallel[CIO].allocated.unsafeToFuture().andThen { case Success((dispatcher, close)) =>
openDispatcher = dispatcher
Dispatcher.parallel[CIO].allocated.unsafeToFuture().andThen { case Success((disp, close)) =>
openDispatcher = disp
closeDispatcher = close
}
}.orDie
}
}

override val aspects = Chunk(
override val aspects: Chunk[TestAspect[Nothing, Any, Nothing, Any]] = Chunk(
TestAspect.timeout(1.minute),
TestAspect.afterAll(ZIO.fromFuture(_ => closeDispatcher.unsafeToFuture()).orDie)
)
Expand Down

0 comments on commit 772233b

Please sign in to comment.