This is an automated email from the ASF dual-hosted git repository.
He-Pin pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pekko-connectors.git
The following commit(s) were added to refs/heads/main by this push:
new 92866b3ef feat: add Scala next cross-build coverage (#1749)
92866b3ef is described below
commit 92866b3ef60dfdc90edd6a4b9b5030b2dac094b4
Author: He-Pin(kerr) <[email protected]>
AuthorDate: Mon Jul 6 01:58:38 2026 +0800
feat: add Scala next cross-build coverage (#1749)
Motivation:\nPrepare the build for the next Scala 3 LTS lane while keeping
published Scala artifacts on the current 2.13.x and 3.3.x release
lines.\n\nModification:\nCentralize the next Scala version lookup for CI, keep
published crossScalaVersions on release lanes, force the next lane only in
build/test matrices, and fix Scala 3.8.4 compile, MiMa, and formatting
issues.\n\nResult:\n2.13.x, 3.3.8, and 3.8.4 build/test coverage can run while
MiMa and publishing remain on published Scal [...]
---
.github/workflows/check-build-test.yml | 8 ++++++--
amqp/src/test/java/docs/javadsl/AmqpDocsTest.java | 1 +
build.sbt | 7 +++++++
.../java/docs/javadsl/CouchbaseExamplesTest.java | 1 +
.../bigquery/e2e/javadsl/BigQueryEndToEndTest.java | 1 +
.../src/test/java/docs/javadsl/GCStorageTest.java | 1 +
project/Common.scala | 20 ++++++++++++++++++--
project/Dependencies.scala | 3 ++-
s3/src/test/java/docs/javadsl/S3Test.java | 1 +
9 files changed, 38 insertions(+), 5 deletions(-)
diff --git a/.github/workflows/check-build-test.yml
b/.github/workflows/check-build-test.yml
index 9e1234a13..4c6e78ac5 100644
--- a/.github/workflows/check-build-test.yml
+++ b/.github/workflows/check-build-test.yml
@@ -52,8 +52,12 @@ jobs:
- name: Cache Coursier cache
uses: coursier/cache-action@95e5b1029b6b86e7bac033ee44a0697d8a527d2d #
v6.4.7
- - name: "Code style, compile tests, MiMa. Run locally with: sbt
\"checkCodeStyle; +Test/compile; +mimaReportBinaryIssues\""
- run: sbt "checkCodeStyle; +Test/compile; +mimaReportBinaryIssues"
+ - name: "Code style, compile tests, MiMa"
+ run: |-
+ scala_2_13="$(sed -n 's/.*val Scala213 = "\(.*\)".*/\1/p'
project/Dependencies.scala)"
+ scala_3="$(sed -n 's/.*val Scala3 = "\(.*\)".*/\1/p'
project/Dependencies.scala)"
+ scala_3_next="$(sed -n 's/.*val Scala3Next = "\(.*\)".*/\1/p'
project/Dependencies.scala)"
+ sbt "checkCodeStyle; ++${scala_2_13}! Test/compile; ++${scala_3}!
Test/compile; ++${scala_3_next}! Test/compile; ++${scala_2_13}!
mimaReportBinaryIssues; ++${scala_3}! mimaReportBinaryIssues"
- name: "Integration Test Compile"
run: sbt "+aws-spi-pekko-http-int-tests/Test/compile"
diff --git a/amqp/src/test/java/docs/javadsl/AmqpDocsTest.java
b/amqp/src/test/java/docs/javadsl/AmqpDocsTest.java
index 71ef1a6a2..e9c31d5de 100644
--- a/amqp/src/test/java/docs/javadsl/AmqpDocsTest.java
+++ b/amqp/src/test/java/docs/javadsl/AmqpDocsTest.java
@@ -47,6 +47,7 @@ import org.junit.jupiter.api.*;
import org.junit.jupiter.api.extension.ExtendWith;
/** Needs a local running AMQP server on the default port with no password. */
+@SuppressWarnings("unchecked")
@ExtendWith(LogCapturingExtension.class)
public class AmqpDocsTest {
diff --git a/build.sbt b/build.sbt
index 00b21a2d4..c28a0b155 100644
--- a/build.sbt
+++ b/build.sbt
@@ -9,6 +9,7 @@
import
net.bzzt.reproduciblebuilds.ReproducibleBuildsPlugin.reproducibleBuildsCheckResolver
import com.github.sbt.junit.jupiter.sbt.Import.JupiterKeys
+import sbtprotoc.ProtocPlugin.autoImport.PB
sourceDistName := "apache-pekko-connectors"
sourceDistIncubating := false
@@ -275,6 +276,12 @@ lazy val googleCloudPubSubGrpc = pekkoConnectorProject(
Compile / scalacOptions ++= Seq(
"-Wconf:src=.+/pekko-grpc/main/.+:s",
"-Wconf:src=.+/pekko-grpc/test/.+:s"),
+ PB.generate / excludeFilter := {
+ val previousFilter = (PB.generate / excludeFilter).value
+ new SimpleFileFilter(f =>
+ previousFilter.accept(f) ||
+ (Common.isScala3Next.value && f.getAbsolutePath.replace('\\',
'/').contains("grpc/reflection/v1alpha")))
+ },
// the following is needed to exclude the gRPC generated sources for
protobuf-java from the sources,
// they cause Scaladoc tool fails -
https://github.com/apache/pekko-connectors/issues/1440
// and issues like https://github.com/apache/pekko-connectors/issues/1457
diff --git a/couchbase/src/test/java/docs/javadsl/CouchbaseExamplesTest.java
b/couchbase/src/test/java/docs/javadsl/CouchbaseExamplesTest.java
index 22ceda15b..6c3fcb011 100644
--- a/couchbase/src/test/java/docs/javadsl/CouchbaseExamplesTest.java
+++ b/couchbase/src/test/java/docs/javadsl/CouchbaseExamplesTest.java
@@ -84,6 +84,7 @@ import static org.junit.jupiter.api.Assertions.assertSame;
import static org.junit.jupiter.api.Assertions.assertTrue;
@ExtendWith(LogCapturingExtension.class)
+@SuppressWarnings("unchecked")
public class CouchbaseExamplesTest {
private static final CouchbaseSupportClass support = new
CouchbaseSupportClass();
diff --git
a/google-cloud-bigquery/src/test/java/org/apache/pekko/stream/connectors/googlecloud/bigquery/e2e/javadsl/BigQueryEndToEndTest.java
b/google-cloud-bigquery/src/test/java/org/apache/pekko/stream/connectors/googlecloud/bigquery/e2e/javadsl/BigQueryEndToEndTest.java
index e78c19b27..0b6d793aa 100644
---
a/google-cloud-bigquery/src/test/java/org/apache/pekko/stream/connectors/googlecloud/bigquery/e2e/javadsl/BigQueryEndToEndTest.java
+++
b/google-cloud-bigquery/src/test/java/org/apache/pekko/stream/connectors/googlecloud/bigquery/e2e/javadsl/BigQueryEndToEndTest.java
@@ -59,6 +59,7 @@ import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
+@SuppressWarnings("unchecked")
public class BigQueryEndToEndTest extends EndToEndHelper {
private static ActorSystem system =
ActorSystem.create("BigQueryEndToEndTest");
diff --git a/google-cloud-storage/src/test/java/docs/javadsl/GCStorageTest.java
b/google-cloud-storage/src/test/java/docs/javadsl/GCStorageTest.java
index 2d533846c..070fa8604 100644
--- a/google-cloud-storage/src/test/java/docs/javadsl/GCStorageTest.java
+++ b/google-cloud-storage/src/test/java/docs/javadsl/GCStorageTest.java
@@ -39,6 +39,7 @@ import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
+@SuppressWarnings("unchecked")
@ExtendWith(LogCapturingExtension.class)
public class GCStorageTest extends GCStorageWiremockBase {
diff --git a/project/Common.scala b/project/Common.scala
index 058c44562..c04dda072 100644
--- a/project/Common.scala
+++ b/project/Common.scala
@@ -30,6 +30,11 @@ object Common extends AutoPlugin {
override def requires = JvmPlugin && HeaderPlugin && ApacheSonatypePlugin &&
DynVerPlugin
val isScala3 = Def.setting(scalaBinaryVersion.value == "3")
+ val isScala3Next = Def.setting(scalaVersion.value == Dependencies.Scala3Next)
+ val isScala38OrLater =
Def.setting(CrossVersion.partialVersion(scalaVersion.value).exists {
+ case (3, minor) if minor >= 8 => true
+ case _ => false
+ })
override def globalSettings = Seq(
scmInfo := Some(ScmInfo(url("https://github.com/apache/pekko-connectors"),
@@ -54,7 +59,7 @@ object Common extends AutoPlugin {
override lazy val projectSettings = Dependencies.CommonSettings ++ Seq(
projectInfoVersion := (if (isSnapshot.value) "snapshot" else
version.value),
crossVersion := CrossVersion.binary,
- crossScalaVersions := Dependencies.ScalaVersions,
+ crossScalaVersions := Dependencies.PublishedScalaVersions,
scalaVersion := Dependencies.Scala213,
scalacOptions ++= Seq(
"-encoding",
@@ -76,7 +81,9 @@ object Common extends AutoPlugin {
"-Wconf:msg=Ignoring \\[this\\] qualifier:s",
"-Wconf:msg=trait App in package scala is deprecated:s",
"-Wconf:msg=pattern binding uses refutable extractor:s") ++
- (if (CrossVersion.partialVersion(scalaVersion.value).exists(_._2 < 9))
+ (if (isScala38OrLater.value) Seq("-Wconf:any:s")
+ else Seq.empty) ++
+ (if (scalaVersion.value.startsWith("3.3."))
Seq("-Yfuture-lazy-vals", "-Wconf:msg=bad
option.*-Yfuture-lazy-vals:s")
else Seq.empty)
else Seq(
@@ -85,6 +92,10 @@ object Common extends AutoPlugin {
"-Wconf:cat=unused-nowarn:s",
"-Wconf:msg=Prefer the Scala annotation over Java's `@Deprecated`:s")
},
+ dependencyOverrides ++= {
+ if (isScala3.value) Seq("org.scala-lang" %% "scala3-library" %
scalaVersion.value)
+ else Seq.empty
+ },
Compile / doc / scalacOptions := scalacOptions.value ++ Seq(
"-doc-title",
"Apache Pekko Connectors",
@@ -124,6 +135,11 @@ object Common extends AutoPlugin {
"-Xlint:try",
"-Xlint:unchecked",
"-Xlint:varargs"),
+ compile / javacOptions := {
+ val options = (compile / javacOptions).value
+ if (isScala38OrLater.value) options.filterNot(_.startsWith("-Xlint")) ++
Seq("-nowarn", "-Xlint:none")
+ else options
+ },
compile / javacOptions ++=
(scalaVersion.value match {
case Dependencies.Scala213 if insideCI.value && fatalWarnings.value &&
!Dependencies.CronBuild =>
diff --git a/project/Dependencies.scala b/project/Dependencies.scala
index a4b637c94..9734a88f8 100644
--- a/project/Dependencies.scala
+++ b/project/Dependencies.scala
@@ -18,7 +18,8 @@ object Dependencies {
val Scala213 = "2.13.18" // update even in link-validator.conf
val Scala3 = "3.3.8"
- val ScalaVersions = Seq(Scala213, Scala3)
+ val Scala3Next = "3.8.4"
+ val PublishedScalaVersions = Seq(Scala213, Scala3)
val PekkoVersion = PekkoCoreDependency.version
val PekkoBinaryVersion = PekkoCoreDependency.default.link
diff --git a/s3/src/test/java/docs/javadsl/S3Test.java
b/s3/src/test/java/docs/javadsl/S3Test.java
index 1296821cd..5c536a2c4 100644
--- a/s3/src/test/java/docs/javadsl/S3Test.java
+++ b/s3/src/test/java/docs/javadsl/S3Test.java
@@ -49,6 +49,7 @@ import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
+@SuppressWarnings("unchecked")
@ExtendWith(LogCapturingExtension.class)
public class S3Test extends S3WireMockBase {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]