Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
chunsenwang committed Feb 21, 2024
1 parent 23c5db0 commit 64b9f01
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 39 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,12 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Set up JDK 11 # it auto caches https://github.com/actions/setup-java#caching-packages-dependencies
uses: actions/setup-java@v3.11.0
with:
java-version: '11'
distribution: 'temurin'
cache: 'sbt'

- name: Run tests
run: SBT_VERSION="${{ matrix.sbt_version }}" make test
run: sbt scripted
1 change: 0 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ enablePlugins(SbtPlugin)
sbtPlugin := true
name := """sbt-slick-codegen"""
organization := "com.tubitv"
version := "0.0.1-SNAPSHOT"

libraryDependencies ++= Seq(
"com.typesafe.slick" %% "slick" % Versions.slick,
Expand Down
22 changes: 0 additions & 22 deletions jd-gui.cfg

This file was deleted.

1 change: 1 addition & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//addSbtPlugin("org.scalariform" % "sbt-scalariform" % "1.8.3")
//addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.18")
//addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.2.1")
addSbtPlugin("com.github.sbt" % "sbt-dynver" % "5.0.1")
17 changes: 7 additions & 10 deletions src/sbt-test/test/basic/build.sbt
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@

crossScalaVersions := Seq("2.12.15", "2.13.8")

Global / onChangedBuildSource := ReloadOnSourceChanges

libraryDependencies += "com.typesafe.slick" %% "slick" % System.getProperty("slick.version")

enablePlugins(CodegenPlugin)

Compile / sourceGenerators += slickCodegen

slickCodegenDatabaseUrl := "jdbc:postgresql://postgres/example"

slickCodegenDatabaseUser := "test"

slickCodegenDatabasePassword := "test"
slickCodegenOutputContainer := "Table"
slickCodegenOutputPackage := "com.demo"
//)

slickCodegenOutputToMultipleFiles := true
codeGen("etl")(
slickCodegenOutputContainer := "Etl",
)
2 changes: 1 addition & 1 deletion src/sbt-test/test/basic/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
sys.props.get("plugin.version") match {
case Some(x) => addSbtPlugin("com.github.tototoshi" % "sbt-slick-codegen" % x)
case Some(x) => addSbtPlugin("com.tubitv" % "sbt-slick-codegen" % x)
case _ => sys.error("""|The system property 'plugin.version' is not defined.
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
}
Expand Down
Empty file.
7 changes: 3 additions & 4 deletions src/sbt-test/test/basic/test
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
$ exec psql -c 'create table if not exists users (id bigint primary key, name varchar(256));' -U test -h postgres example
> + compile
> + slickCodegenAll

$ exists target/scala-2.13/src_managed/main/com/example/Tables.scala
$ exists target/scala-2.13/src_managed/main/com/example/UsersTable.scala
$ exists src/main/scala/com/demo/Table.scala
$ exists src/main/scala/com/example/Etl.scala

0 comments on commit 64b9f01

Please sign in to comment.