Skip to content

Commit

Permalink
allow test with pekko 1.0.x snapshot (#333)
Browse files Browse the repository at this point in the history
* allow test with pekko 1.0.x snapshot

* Update PekkoDependency.scala

* Update PekkoDependency.scala

* rename config value to `1.0.x`

* Update nightly.yml to include 1.0.x run

* Update PekkoDependency.scala
  • Loading branch information
pjfanning authored Oct 29, 2023
1 parent 74b8039 commit a7676ef
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
matrix:
SCALA_VERSION: [2.12, 2.13, 3]
JDK: [8, 11, 17, 21]
PEKKO_VERSION: [default, main]
PEKKO_VERSION: ['default', 'main', '1.0.x']
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
7 changes: 6 additions & 1 deletion project/PekkoDependency.scala
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ object PekkoDependency {
case None =>
Option(System.getProperty("pekko.http.build.pekko.version")) match {
case Some("main") => mainSnapshot
case Some("1.0.x") => snapshot10x
case Some("default") | None => Artifact(defaultVersion)
case Some(other) => Artifact(other, true)
}
Expand All @@ -55,6 +56,7 @@ object PekkoDependency {
val default = pekkoDependency(defaultVersion = minimumExpectedPekkoVersion)
def docs = default

lazy val snapshot10x = Artifact(determineLatestSnapshot("1.0"), true)
lazy val mainSnapshot = Artifact(determineLatestSnapshot(), true)

val pekkoVersion: String = default match {
Expand Down Expand Up @@ -106,6 +108,8 @@ object PekkoDependency {
s"${Resolver.ApacheMavenSnapshotsRepo.root}org/apache/pekko/pekko-cluster-sharding-typed_2.13/")),
10.seconds).bodyAsString

// we use tagNumber set as Integer.MAX_VALUE when there is no tagNumber
// this ensures that RC and Milistone versions are treated as older than non-RC/non-milestone versions
val allVersions =
snapshotVersionR.findAllMatchIn(body)
.map {
Expand All @@ -114,11 +118,12 @@ object PekkoDependency {
ep.toInt,
maj.toInt,
min.toInt,
Option(tagNumber).map(_.toInt),
Option(tagNumber).map(_.toInt).getOrElse(Integer.MAX_VALUE),
offset.toInt) -> full
}
.filter(_._2.startsWith(prefix))
.toVector.sortBy(_._1)

allVersions.last._2
}
}

0 comments on commit a7676ef

Please sign in to comment.