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-projection.git
The following commit(s) were added to refs/heads/main by this push:
new b39cc8dc feat: add Scala next cross-build coverage (#559)
b39cc8dc is described below
commit b39cc8dc2c4b2366a3dcabd7c7d0f4c56ed9670e
Author: He-Pin(kerr) <[email protected]>
AuthorDate: Mon Jul 6 03:39:32 2026 +0800
feat: add Scala next cross-build coverage (#559)
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/scripts/resolve-scala-version.sh | 48 ++++++++++++++++++++++
.github/workflows/integration-tests-cassandra.yml | 5 ++-
.github/workflows/integration-tests-jdbc.yml | 5 ++-
.github/workflows/integration-tests-kafka.yml | 5 ++-
.github/workflows/integration-tests-r2dbc.yml | 15 +++++--
.github/workflows/integration-tests-slick.yml | 5 ++-
.github/workflows/unit-tests.yml | 6 ++-
build.sbt | 14 +++++--
.../pekko/projection/grpc/event_producer.proto | 2 -
project/Common.scala | 2 +-
project/Dependencies.scala | 3 +-
project/PekkoDisciplinePlugin.scala | 9 +++-
12 files changed, 101 insertions(+), 18 deletions(-)
diff --git a/.github/scripts/resolve-scala-version.sh
b/.github/scripts/resolve-scala-version.sh
new file mode 100644
index 00000000..55e8b6f0
--- /dev/null
+++ b/.github/scripts/resolve-scala-version.sh
@@ -0,0 +1,48 @@
+#!/usr/bin/env bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+set -euo pipefail
+
+scala_version="${1:?scala version is required}"
+repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
+
+resolve_from_build() {
+ local pattern="$1"
+ local resolved
+ resolved="$(sed -n "$pattern" "$repo_root/project/Dependencies.scala")"
+ if [ -z "$resolved" ]; then
+ echo "Unable to resolve Scala version '$scala_version' from
project/Dependencies.scala" >&2
+ exit 1
+ fi
+ printf '%s\n' "$resolved"
+}
+
+case "$scala_version" in
+ 2.13 | 2.13.x | scala213)
+ resolve_from_build 's/.*val Scala213 = "\(.*\)".*/\1/p'
+ ;;
+ 3.3 | 3.3.x | scala3)
+ resolve_from_build 's/.*val Scala3 = "\(.*\)".*/\1/p'
+ ;;
+ next)
+ resolve_from_build 's/.*val Scala3Next = "\(.*\)".*/\1/p'
+ ;;
+ *)
+ printf '%s\n' "$scala_version"
+ ;;
+esac
diff --git a/.github/workflows/integration-tests-cassandra.yml
b/.github/workflows/integration-tests-cassandra.yml
index bec7c55d..0c37ab30 100644
--- a/.github/workflows/integration-tests-cassandra.yml
+++ b/.github/workflows/integration-tests-cassandra.yml
@@ -26,6 +26,7 @@ jobs:
include:
- { java-version: 17, scala-version: 2.13, sbt-opts: '' }
- { java-version: 17, scala-version: 3.3, sbt-opts: '' }
+ - { java-version: 17, scala-version: next, sbt-opts: '' }
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 #
v7.0.0
@@ -52,7 +53,9 @@ jobs:
uses: coursier/cache-action@95e5b1029b6b86e7bac033ee44a0697d8a527d2d #
v8.1.1
- name: Run all integration tests with Scala ${{ matrix.scala-version }}
and Java ${{ matrix.java-version }}
- run: sbt ++${{ matrix.scala-version }} cassandra-test/test ${{
matrix.sbt-opts }}
+ run: |-
+ scala_version="$(bash .github/scripts/resolve-scala-version.sh "${{
matrix.scala-version }}")"
+ sbt "++${scala_version}!" cassandra-test/test ${{ matrix.sbt-opts }}
env: # Disable Ryuk resource reaper since we always spin up fresh VMs
TESTCONTAINERS_RYUK_DISABLED: true
diff --git a/.github/workflows/integration-tests-jdbc.yml
b/.github/workflows/integration-tests-jdbc.yml
index d156161f..b59c724f 100644
--- a/.github/workflows/integration-tests-jdbc.yml
+++ b/.github/workflows/integration-tests-jdbc.yml
@@ -26,6 +26,7 @@ jobs:
include:
- { java-version: 17, scala-version: 2.13, sbt-opts: '' }
- { java-version: 17, scala-version: 3.3, sbt-opts: '' }
+ - { java-version: 17, scala-version: next, sbt-opts: '' }
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 #
v7.0.0
@@ -56,7 +57,9 @@ jobs:
uses: coursier/cache-action@95e5b1029b6b86e7bac033ee44a0697d8a527d2d #
v8.1.1
- name: Run all integration tests with Scala ${{ matrix.scala-version }}
and Java ${{ matrix.java-version }}
- run: sbt ++${{ matrix.scala-version }} jdbc-int-test/test ${{
matrix.sbt-opts }}
+ run: |-
+ scala_version="$(bash .github/scripts/resolve-scala-version.sh "${{
matrix.scala-version }}")"
+ sbt "++${scala_version}!" jdbc-int-test/test ${{ matrix.sbt-opts }}
env: # Disable Ryuk resource reaper since we always spin up fresh VMs
TESTCONTAINERS_RYUK_DISABLED: true
diff --git a/.github/workflows/integration-tests-kafka.yml
b/.github/workflows/integration-tests-kafka.yml
index f7a501e7..a5f7706e 100644
--- a/.github/workflows/integration-tests-kafka.yml
+++ b/.github/workflows/integration-tests-kafka.yml
@@ -26,6 +26,7 @@ jobs:
include:
- { java-version: 17, scala-version: 2.13, sbt-opts: '' }
- { java-version: 17, scala-version: 3.3, sbt-opts: '' }
+ - { java-version: 17, scala-version: next, sbt-opts: '' }
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 #
v7.0.0
@@ -52,7 +53,9 @@ jobs:
uses: coursier/cache-action@95e5b1029b6b86e7bac033ee44a0697d8a527d2d #
v8.1.1
- name: Run all integration tests with Scala ${{ matrix.scala-version }}
and Java ${{ matrix.java-version }}
- run: sbt ++${{ matrix.scala-version }} kafka-test/test ${{
matrix.sbt-opts }}
+ run: |-
+ scala_version="$(bash .github/scripts/resolve-scala-version.sh "${{
matrix.scala-version }}")"
+ sbt "++${scala_version}!" kafka-test/test ${{ matrix.sbt-opts }}
env: # Disable Ryuk resource reaper since we always spin up fresh VMs
TESTCONTAINERS_RYUK_DISABLED: true
diff --git a/.github/workflows/integration-tests-r2dbc.yml
b/.github/workflows/integration-tests-r2dbc.yml
index 1d3a6c01..b2aed7fb 100644
--- a/.github/workflows/integration-tests-r2dbc.yml
+++ b/.github/workflows/integration-tests-r2dbc.yml
@@ -28,6 +28,7 @@ jobs:
matrix:
include:
- { java-version: 17, scala-version: 2.13, sbt-opts: '' }
+ - { java-version: 17, scala-version: next, sbt-opts: '' }
steps:
- name: Checkout
@@ -73,7 +74,9 @@ jobs:
docker exec -i docker-postgres-db-1 psql -U postgres -t -d database2
< r2dbc-int-test/ddl-scripts/create_tables_postgres.sql
- name: Run all integration tests with default Scala and Java ${{
matrix.java-version }}
- run: sbt ++${{ matrix.scala-version }} "r2dbc-int-test/test" ${{
matrix.extraOpts }}
+ run: |-
+ scala_version="$(bash .github/scripts/resolve-scala-version.sh "${{
matrix.scala-version }}")"
+ sbt "++${scala_version}!" "r2dbc-int-test/test" ${{ matrix.sbt-opts
}}
- name: Print logs on failure
if: ${{ failure() }}
@@ -88,6 +91,7 @@ jobs:
matrix:
include:
- { java-version: 17, scala-version: 2.13, sbt-opts: '' }
+ - { java-version: 17, scala-version: next, sbt-opts: '' }
steps:
- name: Checkout
@@ -133,7 +137,9 @@ jobs:
docker exec -i yb-tserver-n1 /home/yugabyte/bin/ysqlsh -h
yb-tserver-n1 -t -d database2 <
r2dbc-int-test/ddl-scripts/create_tables_yugabyte.sql
- name: test
- run: sbt -Dpekko.persistence.r2dbc.dialect=yugabyte
-Dpekko.projection.r2dbc.dialect=yugabyte ++${{ matrix.scala-version }}
"r2dbc-int-test/test" ${{ matrix.extraOpts }}
+ run: |-
+ scala_version="$(bash .github/scripts/resolve-scala-version.sh "${{
matrix.scala-version }}")"
+ sbt -Dpekko.persistence.r2dbc.dialect=yugabyte
-Dpekko.projection.r2dbc.dialect=yugabyte "++${scala_version}!"
"r2dbc-int-test/test" ${{ matrix.sbt-opts }}
- name: Print logs on failure
if: ${{ failure() }}
@@ -148,6 +154,7 @@ jobs:
matrix:
include:
- { java-version: 17, scala-version: 2.13, sbt-opts: '' }
+ - { java-version: 17, scala-version: next, sbt-opts: '' }
steps:
- name: Checkout
@@ -193,7 +200,9 @@ jobs:
docker exec -i docker-mysql-db-1 mysql -h 127.0.0.1 --user=root
--password=root --database=database2 <
r2dbc-int-test/ddl-scripts/create_tables_mysql.sql
- name: test
- run: sbt -Dpekko.persistence.r2dbc.dialect=mysql
-Dpekko.projection.r2dbc.dialect=mysql ++${{ matrix.scala-version }}
"r2dbc-int-test/test" ${{ matrix.extraOpts }}
+ run: |-
+ scala_version="$(bash .github/scripts/resolve-scala-version.sh "${{
matrix.scala-version }}")"
+ sbt -Dpekko.persistence.r2dbc.dialect=mysql
-Dpekko.projection.r2dbc.dialect=mysql "++${scala_version}!"
"r2dbc-int-test/test" ${{ matrix.sbt-opts }}
- name: Print logs on failure
if: ${{ failure() }}
diff --git a/.github/workflows/integration-tests-slick.yml
b/.github/workflows/integration-tests-slick.yml
index a4f6e902..ca9ccfe9 100644
--- a/.github/workflows/integration-tests-slick.yml
+++ b/.github/workflows/integration-tests-slick.yml
@@ -26,6 +26,7 @@ jobs:
include:
- { java-version: 17, scala-version: 2.13, sbt-opts: '' }
- { java-version: 17, scala-version: 3.3, sbt-opts: '' }
+ - { java-version: 17, scala-version: next, sbt-opts: '' }
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 #
v7.0.0
@@ -56,7 +57,9 @@ jobs:
uses: coursier/cache-action@95e5b1029b6b86e7bac033ee44a0697d8a527d2d #
v8.1.1
- name: Run all integration tests with Scala ${{ matrix.scala-version }}
and Java ${{ matrix.java-version }}
- run: sbt ++${{ matrix.scala-version }} slick-int-test/test ${{
matrix.sbt-opts }}
+ run: |-
+ scala_version="$(bash .github/scripts/resolve-scala-version.sh "${{
matrix.scala-version }}")"
+ sbt "++${scala_version}!" slick-int-test/test ${{ matrix.sbt-opts }}
env: # Disable Ryuk resource reaper since we always spin up fresh VMs
TESTCONTAINERS_RYUK_DISABLED: true
diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml
index 3a4fc51d..5d38b352 100644
--- a/.github/workflows/unit-tests.yml
+++ b/.github/workflows/unit-tests.yml
@@ -27,6 +27,8 @@ jobs:
- { java-version: 21, scala-version: 2.13, sbt-opts: '' }
- { java-version: 17, scala-version: 3.3, sbt-opts: '' }
- { java-version: 21, scala-version: 3.3, sbt-opts: '' }
+ - { java-version: 17, scala-version: next, sbt-opts: '' }
+ - { java-version: 21, scala-version: next, sbt-opts: '' }
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 #
v7.0.0
@@ -53,7 +55,9 @@ jobs:
uses: coursier/cache-action@95e5b1029b6b86e7bac033ee44a0697d8a527d2d #
v8.1.1
- name: Run tests with Scala ${{ matrix.scala-version }} and Java ${{
matrix.java-version }}
- run: sbt "++${{ matrix.scala-version }} test" ${{ matrix.sbt-opts }}
+ run: |-
+ scala_version="$(bash .github/scripts/resolve-scala-version.sh "${{
matrix.scala-version }}")"
+ sbt "++${scala_version}! test" ${{ matrix.sbt-opts }}
- name: Print logs on failure
if: ${{ failure() }}
diff --git a/build.sbt b/build.sbt
index 6f0e31ff..e1ae7498 100644
--- a/build.sbt
+++ b/build.sbt
@@ -22,6 +22,7 @@ ThisBuild / javafmtFormatterCompatibleJavaVersion := 17
ThisBuild / JupiterKeys.junitJupiterVersion := "6.1.0"
ThisBuild / JupiterKeys.junitPlatformVersion := "6.1.0"
+Global / excludeLintKeys ++= Set(JupiterKeys.junitJupiterVersion,
JupiterKeys.junitPlatformVersion)
lazy val core =
Project(id = "core", base = file("core"))
@@ -235,10 +236,14 @@ lazy val r2dbcIntTest =
publish / skip := true,
Test / parallelExecution := false,
// there are some compile warnings in the test code (Scala 2.13)
- scalacOptions ++= Seq(
- "-Wconf:msg=Implicit resolves to enclosing:s",
- "-Wconf:msg=outer reference in this type test:s",
- "-Wconf:cat=lint:s"))
+ scalacOptions ++= {
+ if (scalaVersion.value.startsWith("2."))
+ Seq(
+ "-Wconf:msg=Implicit resolves to enclosing:s",
+ "-Wconf:msg=outer reference in this type test:s",
+ "-Wconf:cat=lint:s")
+ else Seq.empty
+ })
.dependsOn(core)
.dependsOn(coreTest % "test->test")
.dependsOn(r2dbc % "test->test;test->compile")
@@ -289,6 +294,7 @@ lazy val docs = project
publish / skip := true,
makeSite := makeSite.dependsOn(LocalRootProject / ScalaUnidoc / doc).value,
previewPath := (Paradox / siteSubdirName).value,
+ Global / excludeLintKeys += previewPath,
Preprocess / siteSubdirName :=
s"api/pekko-projection/${projectInfoVersion.value}",
Preprocess / sourceDirectory := (LocalRootProject / ScalaUnidoc / unidoc /
target).value,
Paradox / siteSubdirName :=
s"docs/pekko-projection/${projectInfoVersion.value}",
diff --git
a/grpc/src/main/protobuf/org/apache/pekko/projection/grpc/event_producer.proto
b/grpc/src/main/protobuf/org/apache/pekko/projection/grpc/event_producer.proto
index 5a679c8d..43692fcb 100644
---
a/grpc/src/main/protobuf/org/apache/pekko/projection/grpc/event_producer.proto
+++
b/grpc/src/main/protobuf/org/apache/pekko/projection/grpc/event_producer.proto
@@ -15,7 +15,6 @@ package org.apache.pekko.projection.grpc;
import "google/protobuf/any.proto";
import "google/protobuf/timestamp.proto";
-import "google/protobuf/empty.proto";
option java_package = "org.apache.pekko.projection.grpc.internal.proto";
@@ -205,4 +204,3 @@ message LoadEventResponse {
}
}
-
diff --git a/project/Common.scala b/project/Common.scala
index 8dd436b0..808b01fd 100644
--- a/project/Common.scala
+++ b/project/Common.scala
@@ -45,7 +45,7 @@ object Common extends AutoPlugin {
override lazy val projectSettings = Seq(
projectInfoVersion := (if (isSnapshot.value) "snapshot" else
version.value),
crossVersion := CrossVersion.binary,
- crossScalaVersions := Dependencies.ScalaVersions,
+ crossScalaVersions := Dependencies.PublishedScalaVersions,
scalaVersion := Dependencies.Scala213,
javacOptions ++= List("-Xlint:unchecked", "-Xlint:deprecation"),
Compile / doc / scalacOptions := scalacOptions.value ++ Seq(
diff --git a/project/Dependencies.scala b/project/Dependencies.scala
index 8baa174b..6bc0a3c0 100644
--- a/project/Dependencies.scala
+++ b/project/Dependencies.scala
@@ -16,7 +16,8 @@ object Dependencies {
val Scala213 = "2.13.18"
val Scala3 = "3.3.8"
- val ScalaVersions = Seq(Scala213, Scala3)
+ val Scala3Next = "3.8.4"
+ val PublishedScalaVersions = Seq(Scala213, Scala3)
val PekkoVersionInDocs = PekkoCoreDependency.default.link
val PekkoGrpcVersionInDocs = "2.0"
diff --git a/project/PekkoDisciplinePlugin.scala
b/project/PekkoDisciplinePlugin.scala
index c2caaf89..61811caa 100644
--- a/project/PekkoDisciplinePlugin.scala
+++ b/project/PekkoDisciplinePlugin.scala
@@ -44,10 +44,15 @@ object PekkoDisciplinePlugin extends AutoPlugin {
"-Xlint:-strict-unsealed-patmat",
// scala/bug#7014 is a false positive compiler warning
affecting r2dbc-spi jar loading
"-Wconf:msg=scala/bug#7014:s")
+ case _ =>
+ Nil
+ }).toSeq,
+ scalacOptions ++=
+ (CrossVersion.partialVersion(scalaVersion.value) match {
case Some((3, _)) =>
Set(
"-release:17",
- "-Wconf:msg=Implicit parameters should be provided with a
`using` clause:s",
+ "-Wconf:msg=.*Implicit parameters should be provided with
a.*using.*clause.*:s",
"-Wconf:msg=is deprecated for wildcard arguments of types:s",
"-Wconf:msg=The trailing ` _` for eta-expansion is
unnecessary:s",
"-Wconf:msg=with as a type operator has been deprecated:s",
@@ -57,7 +62,7 @@ object PekkoDisciplinePlugin extends AutoPlugin {
"-Wconf:msg=Xfatal-warnings is a deprecated alias:s",
"-Wconf:msg=Ignoring \\[this\\] qualifier:s",
"-Wconf:msg=trait App in package scala is deprecated:s") ++
- (if (CrossVersion.partialVersion(scalaVersion.value).exists(_._2
< 9))
+ (if (scalaVersion.value.startsWith("3.3."))
Seq("-Yfuture-lazy-vals", "-Wconf:msg=bad
option.*-Yfuture-lazy-vals:s")
else Seq.empty)
case _ =>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]