Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

internal: Add Scala 3.5.x CI test #3590

Merged
merged 2 commits into from
Sep 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,26 @@ jobs:
check_name: Test Report Scala 3.x
annotate_only: true
detailed_summary: true
test_3_latest:
name: Scala 3.5.x
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '21'
- name: Scala 3.5.x test
# Test only Scala 3 supported projects
run: SCALA_VERSION=3.5.1 ./sbt "projectDotty/test; dottyTest/run"
- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: always() # always run even if the previous step fails
with:
report_paths: '**/target/test-reports/TEST-*.xml'
check_name: Test Report Scala 3.5.x
annotate_only: true
detailed_summary: true
test_3_latest_jdk:
name: Scala 3 / JDK17
runs-on: ubuntu-latest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ object RouteMatcher extends LogSupport {
}

def findRoute[Req](request: Req)(implicit tp: HttpRequestAdapter[Req]): Option[RouteMatch] = {
routesByMethod.get(tp.methodOf(request)).flatMap { nextRouter => nextRouter.findRoute(request)(tp) }
routesByMethod.get(tp.methodOf(request)).flatMap { nextRouter => nextRouter.findRoute(request)(using tp) }
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,20 @@ class PathDependentTypeTest extends AirSpec:

test("pass dependent types") {
val s = Surface.of[MyProfile#Backend]
s.name shouldBe "Backend"
s.toString shouldBe "Backend:=MyBackend"
if s.name == "MyBackend" then
// Scala 3.5.x or later
s.toString shouldBe "MyBackend"
else
s.name shouldBe "Backend"
s.toString shouldBe "Backend:=MyBackend"
}

test("nested path dependent types") {
val s = Surface.of[MyProfile#Backend#Database]
s.name shouldBe "Database"
s.toString shouldBe "Database:=DatabaseDef"
if s.name == "DatabaseDef" then
// Scala 3.5.x or later
s.toString shouldBe "DatabaseDef"
else
s.name shouldBe "Database"
s.toString shouldBe "Database:=DatabaseDef"
}
3 changes: 2 additions & 1 deletion airspec/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ def excludePomDependency(excludes: Seq[String]) = { node: XmlNode =>
}).transform(node).head
}

/** AirSpec build definitions.
/**
* AirSpec build definitions.
*
* To make AirSpec a standalone library without any cyclic project references, AirSpec embeds the source code of
* airframe-log, di, surface, etc.
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import xerial.sbt.pack.PackPlugin.{projectSettings, publishPackArchiveTgz}

val SCALA_2_12 = "2.12.20"
val SCALA_2_13 = "2.13.15"
val SCALA_3 = "3.3.4"
val SCALA_3 = sys.env.getOrElse("SCALA_VERSION", "3.3.4")
val uptoScala2 = SCALA_2_13 :: SCALA_2_12 :: Nil
val targetScalaVersions = SCALA_3 :: uptoScala2

Expand Down
Loading