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-persistence-cassandra.git


The following commit(s) were added to refs/heads/main by this push:
     new d95d7fe  feat: add Scala next cross-build coverage (#445)
d95d7fe is described below

commit d95d7fea081f5633d37caefb03d0a3ecbf18410c
Author: He-Pin(kerr) <[email protected]>
AuthorDate: Mon Jul 6 03:01:26 2026 +0800

    feat: add Scala next cross-build coverage (#445)
    
    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/unit-tests.yml         | 19 +++++++------
 project/Common.scala                     |  4 +--
 project/Dependencies.scala               |  3 +-
 4 files changed, 63 insertions(+), 11 deletions(-)

diff --git a/.github/scripts/resolve-scala-version.sh 
b/.github/scripts/resolve-scala-version.sh
new file mode 100644
index 0000000..f631a19
--- /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 scala213Version = "\(.*\)".*/\1/p'
+    ;;
+  3.3 | 3.3.x | scala3)
+    resolve_from_build 's/.*val scala3Version = "\(.*\)".*/\1/p'
+    ;;
+  next)
+    resolve_from_build 's/.*val scala3NextVersion = "\(.*\)".*/\1/p'
+    ;;
+  *)
+    printf '%s\n' "$scala_version"
+    ;;
+esac
diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml
index 14efd27..4a4995e 100644
--- a/.github/workflows/unit-tests.yml
+++ b/.github/workflows/unit-tests.yml
@@ -28,13 +28,15 @@ jobs:
       fail-fast: false
       matrix:
         include:
-          - { javaVersion: '17',  container: "cassandra-latest",  
scalaVersion: "++2.13", test: "test" }
-          - { javaVersion: '17',  container: "cassandra-latest",  
scalaVersion: "++3.3", test: "test" }
-          - { javaVersion: '21', container: "cassandra-latest",  scalaVersion: 
"++2.13", test: "test" }
-          - { javaVersion: '21', container: "cassandra-latest",  scalaVersion: 
"++3.3", test: "test" }
-          - { javaVersion: '17', container: "cassandra2",        scalaVersion: 
"++2.13", test: "'testOnly -- -l RequiresCassandraThree'"}
-          - { javaVersion: '17', container: "cassandra3",        scalaVersion: 
"++2.13", test: "test" }
-          - { javaVersion: '17', container: "scylladb-latest",   scalaVersion: 
"++2.13", test: "test" }
+          - { javaVersion: '17',  container: "cassandra-latest",  
scalaVersion: "2.13", test: "test" }
+          - { javaVersion: '17',  container: "cassandra-latest",  
scalaVersion: "3.3", test: "test" }
+          - { javaVersion: '17',  container: "cassandra-latest",  
scalaVersion: "next", test: "test" }
+          - { javaVersion: '21', container: "cassandra-latest",  scalaVersion: 
"2.13", test: "test" }
+          - { javaVersion: '21', container: "cassandra-latest",  scalaVersion: 
"3.3", test: "test" }
+          - { javaVersion: '21', container: "cassandra-latest",  scalaVersion: 
"next", test: "test" }
+          - { javaVersion: '17', container: "cassandra2",        scalaVersion: 
"2.13", test: "'testOnly -- -l RequiresCassandraThree'"}
+          - { javaVersion: '17', container: "cassandra3",        scalaVersion: 
"2.13", test: "test" }
+          - { javaVersion: '17', container: "scylladb-latest",   scalaVersion: 
"2.13", test: "test" }
 
     env:
       JAVA_OPTS: -Xms2G -Xmx2G -Xss2M -XX:ReservedCodeCacheSize=256M 
-Dfile.encoding=UTF-8
@@ -63,7 +65,8 @@ jobs:
 
       - name: Test against ${{ matrix.container }}
         run: |-
-          docker compose up -d ${{ matrix.container }} && sbt ${{ 
matrix.scalaVersion }} ${{matrix.test}}
+          scala_version="$(bash .github/scripts/resolve-scala-version.sh "${{ 
matrix.scalaVersion }}")"
+          docker compose up -d ${{ matrix.container }} && sbt 
"++${scala_version}!" ${{matrix.test}}
 
   mima:
     name: MiMa check
diff --git a/project/Common.scala b/project/Common.scala
index 2b71070..bee717e 100644
--- a/project/Common.scala
+++ b/project/Common.scala
@@ -42,7 +42,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.scala213Version,
     scalacOptions ++= Seq("-encoding", "UTF-8", "-feature", "-unchecked", 
"-deprecation"),
     scalacOptions ++= {
@@ -57,7 +57,7 @@ object Common extends AutoPlugin {
           "-Wconf:msg=is no longer supported for vararg splices:s",
           "-Wconf:msg=bad option.*-Xlint:s",
           "-Wconf:msg=bad option.*-Ywarn-dead-code: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)
       else Seq("-Xlint", "-Ywarn-dead-code")
diff --git a/project/Dependencies.scala b/project/Dependencies.scala
index 7d2f5f7..7cad214 100644
--- a/project/Dependencies.scala
+++ b/project/Dependencies.scala
@@ -13,7 +13,8 @@ object Dependencies {
   // keep in sync with .github/workflows/unit-tests.yml
   val scala213Version = "2.13.18"
   val scala3Version = "3.3.8"
-  val scalaVersions = Seq(scala213Version, scala3Version)
+  val scala3NextVersion = "3.8.4"
+  val publishedScalaVersions = Seq(scala213Version, scala3Version)
 
   val pekkoVersion = PekkoCoreDependency.version
   val pekkoVersionInDocs = PekkoCoreDependency.default.link


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to