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

[5.0.x] Various Backports #677

Merged
merged 10 commits into from
May 17, 2022
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
110 changes: 0 additions & 110 deletions .github/settings.yml

This file was deleted.

48 changes: 48 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Check

on:
pull_request:

push:
branches:
- 5.0.x # Check 5.0.x branch after merge

concurrency:
# Only run once for latest commit per ref and cancel other (previous) runs.
group: ci-${{ github.ref }}
cancel-in-progress: true

jobs:
check-code-style:
name: Code Style
uses: playframework/.github/.github/workflows/cmd.yml@v2
with:
cmd: sbt scalafmtCheckAll scalafmtSbtCheck

check-binary-compatibility:
name: Binary Compatibility
uses: playframework/.github/.github/workflows/binary-check.yml@v2

check-docs:
name: Docs
uses: playframework/.github/.github/workflows/cmd.yml@v2
with:
cmd: sbt docs/scalafmtCheckAll docs/scalafmtSbtCheck docs/test docs/validateDocs

tests:
name: Tests
needs: # Waiting more lightweight checks
- "check-code-style"
- "check-binary-compatibility"
- "check-docs"
uses: playframework/.github/.github/workflows/cmd.yml@v2
with:
java: 11, 8
scala: 2.12.15, 2.13.8
cmd: sbt ++$MATRIX_SCALA test

finish:
name: Finish
needs: # Should be last
- "tests"
uses: playframework/.github/.github/workflows/rtm.yml@v2
13 changes: 13 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Publish

on:
push:
branches: # Snapshots
- 5.0.x
tags: ["*"] # Releases

jobs:
publish-artifacts:
name: Publish / Artifacts
uses: playframework/.github/.github/workflows/publish.yml@v2
secrets: inherit
28 changes: 0 additions & 28 deletions .mergify.yml

This file was deleted.

41 changes: 0 additions & 41 deletions .travis.yml

This file was deleted.

24 changes: 2 additions & 22 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@ dynverVTagPrefix in ThisBuild := false
// Sanity-check: assert that version comes from a tag (e.g. not a too-shallow clone)
// https://github.com/dwijnand/sbt-dynver/#sanity-checking-the-version
Global / onLoad := (Global / onLoad).value.andThen { s =>
val v = version.value
if (dynverGitDescribeOutput.value.hasNoTags)
throw new MessageOnlyException(
s"Failed to derive version from git tags. Maybe run `git fetch --unshallow`? Version: $v"
)
dynverAssertTagVersion.value
s
}

Expand All @@ -23,7 +19,7 @@ lazy val commonSettings = Seq(
scalacOptions ~= (_.filterNot(_ == "-Xfatal-warnings")),
scalaVersion := scala213,
crossScalaVersions := Seq(scala213, scala212),
resolvers += Resolver.bintrayRepo("akka", "snapshots")
resolvers += "akka-snapshot-repository".at("https://repo.akka.io/snapshots")
)

lazy val `play-slick-root` = (project in file("."))
Expand All @@ -33,22 +29,6 @@ lazy val `play-slick-root` = (project in file("."))
`play-slick-evolutions`
)
.settings(commonSettings)
.settings(
Seq(
// this overrides releaseProcess to make it work with sbt-dynver
releaseProcess := {
import ReleaseTransformations._
Seq[ReleaseStep](
checkSnapshotDependencies,
runClean,
releaseStepCommandAndRemaining("+test"),
releaseStepCommandAndRemaining("+publishSigned"),
releaseStepCommand("sonatypeBundleRelease"),
pushChanges // <- this needs to be removed when releasing from tag
)
}
)
)

lazy val `play-slick` = (project in file("src/core"))
.enablePlugins(PlayLibrary, Playdoc)
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.3.6
sbt.version=1.3.13
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ addSbtPlugin("com.typesafe.play" % "interplay" % sys.props.get("inter
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.3.0")
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.6.1")

addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.0.0")
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.10")
6 changes: 3 additions & 3 deletions src/core/src/test/scala/play/api/db/slick/SlickApiSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ class SlickApiSpec extends Specification {
"SlickApi.dbConfigs" should {
"return all DatabaseConfig instances for a valid configuration" in {
import SUTWithGoodConfig._
api.dbConfigs[BasicProfile] must have size (4)
api.dbConfigs[BasicProfile]() must have size 4
}
"throw if a database name doesn't exist in the config" in {
import SUTWithBadConfig._
api.dbConfigs[BasicProfile] must throwA[PlayException]
api.dbConfigs[BasicProfile]() must throwA[PlayException]
}
"throw if a database config doesn't define a Slick profile" in {
import SUTWithBadConfig._
api.dbConfigs[BasicProfile] must throwA[PlayException]
api.dbConfigs[BasicProfile]() must throwA[PlayException]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ private[evolutions] class DBApiAdapter @Inject() (slickApi: SlickApi) extends DB
}
.toMap

override def databases: Seq[PlayDatabase] = databasesByName.values.toSeq
override def databases(): Seq[PlayDatabase] = databasesByName.values.toSeq

def database(name: String): PlayDatabase =
databasesByName.getOrElse(DbName(name), throw new IllegalArgumentException(s"Could not find database for $name"))
Expand Down