diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 51f6ccae..b6b876f3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,8 +47,8 @@ jobs: strategy: fail-fast: false matrix: - java: ['adopt@1.8'] - scala: ['2.12.15', '2.13.8', '3.1.2'] + java: ['adopt@17'] + scala: ['2.12.15', '2.13.13', '3.3.3'] steps: - name: Checkout current branch uses: actions/checkout@v3.3.0 @@ -72,7 +72,7 @@ jobs: strategy: fail-fast: false matrix: - java: ['11', '17'] + java: ['17', '21'] steps: - name: Checkout current branch uses: actions/checkout@v3.3.0 diff --git a/.gitignore b/.gitignore index 86c23752..e37e10b8 100644 --- a/.gitignore +++ b/.gitignore @@ -422,3 +422,4 @@ website/static/api .minio.sys/ .vscode/ +/zio-s3/src/test/scala/zio/s3/S3App.scala diff --git a/build.sbt b/build.sbt index 54a67b98..38af4933 100644 --- a/build.sbt +++ b/build.sbt @@ -22,8 +22,8 @@ inThisBuild( addCommandAlias("fmt", "all scalafmtSbt scalafmt test:scalafmt") addCommandAlias("check", "all scalafmtSbtCheck scalafmtCheck test:scalafmtCheck") -val zioVersion = "2.0.2" -val awsVersion = "2.16.61" +val zioVersion = "2.0.21" +val awsVersion = "2.23.4" lazy val root = project.in(file(".")).settings(publish / skip := true).aggregate(`zio-s3`, docs) @@ -38,18 +38,18 @@ lazy val `zio-s3` = project libraryDependencies ++= Seq( "dev.zio" %% "zio" % zioVersion, "dev.zio" %% "zio-streams" % zioVersion, - "dev.zio" %% "zio-nio" % "2.0.0", - "dev.zio" %% "zio-interop-reactivestreams" % "2.0.0", + "dev.zio" %% "zio-nio" % "2.0.2", + "dev.zio" %% "zio-interop-reactivestreams" % "2.0.2", "software.amazon.awssdk" % "s3" % awsVersion, "software.amazon.awssdk" % "sts" % awsVersion, "dev.zio" %% "zio-test" % zioVersion % Test, "dev.zio" %% "zio-test-sbt" % zioVersion % Test ), libraryDependencies ++= { - if (scalaVersion.value == ScalaDotty) - Seq() - else - Seq("org.scala-lang.modules" %% "scala-collection-compat" % "2.8.1") + CrossVersion.partialVersion(scalaVersion.value) match { + case Some((2, _)) => Seq("org.scala-lang.modules" %% "scala-collection-compat" % "2.11.0") + case _ => Seq.empty + } }, testFrameworks += new TestFramework("zio.test.sbt.ZTestFramework") ) diff --git a/project/BuildHelper.scala b/project/BuildHelper.scala index cd15678d..64de4219 100644 --- a/project/BuildHelper.scala +++ b/project/BuildHelper.scala @@ -9,8 +9,8 @@ import scalafix.sbt.ScalafixPlugin.autoImport._ object BuildHelper { val Scala212 = "2.12.15" - val Scala213 = "2.13.8" - val ScalaDotty = "3.1.2" + val Scala213 = "2.13.13" + val ScalaDotty = "3.3.3" private val stdOptions = Seq( "-deprecation", @@ -119,11 +119,11 @@ object BuildHelper { scalacOptions := stdOptions ++ extraOptions(scalaVersion.value, optimize = !isSnapshot.value), semanticdbEnabled := scalaVersion.value != ScalaDotty, // enable SemanticDB semanticdbOptions += "-P:semanticdb:synthetics:on", - semanticdbVersion := scalafixSemanticdb.revision, // use Scalafix compatible version + //semanticdbVersion := scalafixSemanticdb.revision, // use Scalafix compatible version ThisBuild / scalafixScalaBinaryVersion := CrossVersion.binaryScalaVersion(scalaVersion.value), ThisBuild / scalafixDependencies ++= List( - "com.github.liancheng" %% "organize-imports" % "0.4.3", - "com.github.vovapolu" %% "scaluzzi" % "0.1.15" + "com.github.liancheng" %% "organize-imports" % "0.6.0", + "com.github.vovapolu" %% "scaluzzi" % "0.1.23" ), Test / parallelExecution := true, incOptions ~= (_.withLogRecompileOnMacro(false)), diff --git a/project/build.properties b/project/build.properties index d738b858..49214c4b 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version = 1.7.1 +sbt.version = 1.9.9 diff --git a/zio-s3/src/main/scala/zio/s3/Test.scala b/zio-s3/src/main/scala/zio/s3/Test.scala index ce6e9367..eaf25fa0 100644 --- a/zio-s3/src/main/scala/zio/s3/Test.scala +++ b/zio-s3/src/main/scala/zio/s3/Test.scala @@ -78,7 +78,7 @@ object Test { override def getObject(bucketName: String, key: String): Stream[S3Exception, Byte] = ZStream - .scoped(ZIO.fromAutoCloseable(ZIO.attempt(new FileInputStream((path / bucketName / key).toFile)))) + .scoped[Any](ZIO.fromAutoCloseable(ZIO.attempt(new FileInputStream((path / bucketName / key).toFile)))) .flatMap(ZStream.fromInputStream(_, 2048)) .refineOrDie { case e: FileNotFoundException => fileNotFound(e) diff --git a/zio-s3/src/test/scala/zio/s3/S3ProvidersTest.scala b/zio-s3/src/test/scala/zio/s3/S3ProvidersTest.scala index 7aa92bcb..0368bd0a 100644 --- a/zio-s3/src/test/scala/zio/s3/S3ProvidersTest.scala +++ b/zio-s3/src/test/scala/zio/s3/S3ProvidersTest.scala @@ -27,22 +27,22 @@ object S3ProvidersTest extends ZIOSpecDefault { suite("Providers")( test("basic credentials") { ZIO - .scoped(basic("k", "v").map(_.resolveCredentials())) + .scoped[Any](basic("k", "v").map(_.resolveCredentials())) .map(res => assertTrue(res == AwsBasicCredentials.create("k", "v"))) }, test("session credentials") { ZIO - .scoped(session("k", "v", "t").map(_.resolveCredentials())) + .scoped[Any](session("k", "v", "t").map(_.resolveCredentials())) .map(res => assertTrue(res == AwsSessionCredentials.create("k", "v", "t"))) }, test("basic credentials default fallback const") { ZIO - .scoped((env <> basic("k", "v")).map(_.resolveCredentials())) + .scoped[Any]((env <> basic("k", "v")).map(_.resolveCredentials())) .map(res => assertTrue(res == AwsBasicCredentials.create("k", "v"))) }, test("cred in system properties") { for { - cred <- ZIO.scoped(system.flatMap(p => ZIO.attempt(p.resolveCredentials()))) + cred <- ZIO.scoped[Any](system.flatMap(p => ZIO.attempt(p.resolveCredentials()))) } yield assertTrue(cred == AwsBasicCredentials.create("k1", "s1")) } @@ flaky @@ around( setProps(("aws.accessKeyId", "k1"), ("aws.secretAccessKey", "s1")), @@ -50,7 +50,7 @@ object S3ProvidersTest extends ZIOSpecDefault { ), test("no cred in system properties") { for { - failure <- ZIO.scoped(system).flip.map(_.getMessage) + failure <- ZIO.scoped[Any](system).flip.map(_.getMessage) } yield assert(failure)(isNonEmptyString) } @@ around( unsetProps("aws.accessKeyId", "aws.secretAccessKey"), @@ -58,41 +58,41 @@ object S3ProvidersTest extends ZIOSpecDefault { ), test("no cred in environment properties") { for { - failure <- ZIO.scoped(env).flip.map(_.getMessage) + failure <- ZIO.scoped[Any](env).flip.map(_.getMessage) } yield assert(failure)(isNonEmptyString) }, test("no cred in profile") { for { - failure <- ZIO.scoped(profile).flip.map(_.getMessage) + failure <- ZIO.scoped[Any](profile).flip.map(_.getMessage) } yield assert(failure)(isNonEmptyString) }, test("no cred in named profile") { for { - failure <- ZIO.scoped(profile(Some("name"))).flip.map(_.getMessage) + failure <- ZIO.scoped[Any](profile(Some("name"))).flip.map(_.getMessage) } yield assert(failure)(isNonEmptyString) }, test("no cred in container") { for { - failure <- ZIO.scoped(container).flip.map(_.getMessage) + failure <- ZIO.scoped[Any](container).flip.map(_.getMessage) } yield assert(failure)(isNonEmptyString) }, test("no cred in instance profile credentials") { for { - failure <- ZIO.scoped(instanceProfile).flip.map(_.getMessage) + failure <- ZIO.scoped[Any](instanceProfile).flip.map(_.getMessage) } yield assert(failure)(isNonEmptyString) }, test("no cred in webidentity credentials") { for { - failure <- ZIO.scoped(webIdentity).flip.map(_.getMessage) + failure <- ZIO.scoped[Any](webIdentity).flip.map(_.getMessage) } yield assert(failure)(isNonEmptyString) }, test("settings from invalid creds") { for { failure <- ZIO - .scoped( + .scoped[Any]( settings( Region.AF_SOUTH_1, - ZIO.scoped(system).map(_.resolveCredentials()) + ZIO.scoped[Any](system).map(_.resolveCredentials()) ).build ) .flip @@ -100,7 +100,7 @@ object S3ProvidersTest extends ZIOSpecDefault { }, test("no cred when chain all providers") { for { - failure <- ZIO.scoped(default.flatMap(c => ZIO.attempt(c.resolveCredentials()))).flip.map(_.getMessage) + failure <- ZIO.scoped[Any](default.flatMap(c => ZIO.attempt(c.resolveCredentials()))).flip.map(_.getMessage) } yield assert(failure)(isNonEmptyString) } ) @@ sequential