Skip to content

Commit

Permalink
Merge branch 'master' into update/zio-2.0.17
Browse files Browse the repository at this point in the history
  • Loading branch information
guizmaii authored Oct 20, 2023
2 parents 8ee6299 + 07dbbd7 commit 272c5f3
Show file tree
Hide file tree
Showing 191 changed files with 710 additions and 5,399 deletions.
23 changes: 11 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ on:
types: [ published ] # Triggers the CI when a new Github Release is published

env:
JAVA_OPTS: -Xms6G -Xmx6G -XX:+UseG1GC
JDK_JAVA_OPTIONS: -Xms6G -Xmx6G -XX:+UseG1GC # See https://stackoverflow.com/a/73708006
# See:
# - https://stackoverflow.com/a/73708006
# - https://stackoverflow.com/questions/73465937/apache-spark-3-3-0-breaks-on-java-17-with-cannot-access-class-sun-nio-ch-direct
JDK_JAVA_OPTIONS: -Xms6G -Xmx6G -XX:+UseG1GC --add-exports java.base/sun.nio.ch=ALL-UNNAMED

jobs:
build:
Expand All @@ -25,7 +27,7 @@ jobs:
fail-fast: false
matrix:
scala: [2.12.x, 2.13.x, 3.3.x]
module: [base, db, async, codegen, bigdata]
module: [base, db, codegen, bigdata]
include:
- scala: 2.12.x
scala_short: 212
Expand All @@ -40,8 +42,6 @@ jobs:
# For now, only do the `base` build for Scala 3
- scala: 3.3.x
module: db
- scala: 3.3.x
module: async
- scala: 3.3.x
module: codegen
- scala: 3.3.x
Expand All @@ -68,7 +68,7 @@ jobs:
uses: actions/setup-java@v3.12.0
with:
distribution: temurin
java-version: '8'
java-version: '17'
check-latest: true

- name: Build modules
Expand All @@ -82,10 +82,6 @@ jobs:
if: ${{github.event_name != 'pull_request'}}
runs-on: ubuntu-latest
needs: build
strategy:
fail-fast: false
matrix:
scala: [ 2.12.x, 2.13.x, 3.3.x ]
env:
CI_RELEASE: publishSigned # By default, sbt-ci-release uses the `+publishSigned` which is publishing for all the Scala versions configured, which is not what we want
CI_SNAPSHOT_RELEASE: publish # By default, sbt-ci-release uses the `+publish` which is publishing for all the Scala versions configured, which is not what we want
Expand All @@ -95,9 +91,12 @@ jobs:
uses: actions/setup-java@v3.12.0
with:
distribution: temurin
java-version: '8'
java-version: '17'
check-latest: true
- run: sbt ++${{ matrix.scala }} -Dquill.scala.version=${{ matrix.scala }} ci-release
- run: |
sbt ++2.12.x -Dquill.scala.version=2.12.x -Dquill.macro.log=false ci-release
sbt ++2.13.x -Dquill.scala.version=2.13.x -Dquill.macro.log=false ci-release
sbt ++3.3.x -Dquill.scala.version=3.3.x -Dquill.macro.log=false ci-release
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
Expand Down
153 changes: 29 additions & 124 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,6 @@ lazy val dbModules = Seq[sbt.ClasspathDep[sbt.ProjectReference]](
`quill-jdbc-zio`
)

lazy val jasyncModules = Seq[sbt.ClasspathDep[sbt.ProjectReference]](
`quill-jasync`,
`quill-jasync-postgres`,
`quill-jasync-mysql`,
`quill-jasync-zio`,
`quill-jasync-zio-postgres`
)

lazy val codegenModules = Seq[sbt.ClasspathDep[sbt.ProjectReference]](
`quill-codegen`,
`quill-codegen-jdbc`,
Expand All @@ -70,22 +62,10 @@ lazy val bigdataModules = Seq[sbt.ClasspathDep[sbt.ProjectReference]](
)

lazy val allModules =
baseModules ++ dbModules ++ jasyncModules ++ codegenModules ++ bigdataModules ++ docsModules
baseModules ++ dbModules ++ codegenModules ++ bigdataModules ++ docsModules

lazy val scala213Modules =
baseModules ++ dbModules ++ codegenModules ++ Seq[sbt.ClasspathDep[sbt.ProjectReference]](
`quill-cassandra`,
`quill-cassandra-alpakka`,
`quill-cassandra-monix`,
`quill-cassandra-zio`,
`quill-orientdb`,
`quill-jasync`,
`quill-jasync-postgres`,
`quill-jasync-mysql`,
`quill-jasync-zio`,
`quill-jasync-zio-postgres`,
`quill-spark`
)
baseModules ++ dbModules ++ codegenModules ++ bigdataModules

lazy val scala3Modules = Seq[sbt.ClasspathDep[sbt.ProjectReference]](`quill-engine`, `quill-util`)

Expand Down Expand Up @@ -124,40 +104,28 @@ lazy val filteredModules = {
case "db" =>
println("SBT =:> Compiling Database Modules")
dbModules
case "async" =>
println("SBT =:> Compiling Async Database Modules")
jasyncModules
case "codegen" =>
println("SBT =:> Compiling Code Generator Modules")
codegenModules
case "nocodegen" =>
println("Compiling Not-Code Generator Modules")
baseModules ++ dbModules ++ jasyncModules ++ bigdataModules
baseModules ++ dbModules ++ bigdataModules
case "bigdata" =>
println("SBT =:> Compiling Big Data Modules")
bigdataModules
case "none" =>
println("SBT =:> Invoking Aggregate Project")
Seq[sbt.ClasspathDep[sbt.ProjectReference]]()
case _ | "all" =>
// Workaround for https://github.com/sbt/sbt/issues/3465
if (isScala213) {
println("SBT =:> Compiling Scala 2.13 Modules")
baseModules ++ dbModules ++ jasyncModules
} else {
println("SBT =:> Compiling All Modules")
allModules
// Note, can't do this because things like inform (i.e. formatting) actually do run for all modules
// throw new IllegalStateException("Tried to build all modules. Not allowed.")
}
println("SBT =:> Compiling All Modules")
allModules
}

val selectedModules = {
val modules =
moduleStrings
.map(matchModules(_))
.map(seq => ListSet(seq: _*))
.flatMap(elem => elem)
.map(matchModules)
.flatMap(seq => ListSet(seq: _*))

if (isScala213) {
println("SBT =:> Compiling 2.13 Modules Only")
Expand Down Expand Up @@ -227,11 +195,12 @@ lazy val `quill-engine` =
.settings(commonSettings: _*)
.settings(
libraryDependencies ++= Seq(
"com.typesafe" % "config" % "1.4.2",
"com.typesafe.scala-logging" %% "scala-logging" % "3.9.5",
("com.github.takayahilton" %% "sql-formatter" % "1.2.1").cross(CrossVersion.for3Use2_13),
"io.suzaku" %% "boopickle" % "1.4.0",
"com.lihaoyi" %% "pprint" % "0.8.1"
"com.typesafe" % "config" % "1.4.3",
"com.typesafe.scala-logging" %% "scala-logging" % "3.9.5",
("com.github.takayahilton" %% "sql-formatter" % "1.2.1").cross(CrossVersion.for3Use2_13),
"io.suzaku" %% "boopickle" % "1.4.0",
"com.lihaoyi" %% "pprint" % "0.8.1",
"com.github.ben-manes.caffeine" % "caffeine" % "3.1.8"
),
coverageExcludedPackages := "<empty>;.*AstPrinter;.*Using;io.getquill.Model;io.getquill.ScalarTag;io.getquill.QuotationTag"
)
Expand All @@ -242,7 +211,7 @@ lazy val `quill-core` =
.settings(commonSettings: _*)
.settings(
libraryDependencies ++= Seq(
"com.typesafe" % "config" % "1.4.2",
"com.typesafe" % "config" % "1.4.3",
"dev.zio" %% "zio-logging" % "2.1.14",
"dev.zio" %% "zio" % Version.zio,
"dev.zio" %% "zio-streams" % Version.zio,
Expand Down Expand Up @@ -338,8 +307,8 @@ lazy val `quill-doobie` =
.settings(jdbcTestingSettings: _*)
.settings(
libraryDependencies ++= Seq(
"org.tpolecat" %% "doobie-core" % "1.0.0-RC2",
"org.tpolecat" %% "doobie-postgres" % "1.0.0-RC2" % Test
"org.tpolecat" %% "doobie-core" % "1.0.0-RC4",
"org.tpolecat" %% "doobie-postgres" % "1.0.0-RC4" % Test
)
)
.dependsOn(`quill-jdbc` % "compile->compile;test->test")
Expand Down Expand Up @@ -441,71 +410,6 @@ lazy val `quill-spark` =
.dependsOn(`quill-sql` % "compile->compile;test->test")
.enablePlugins(MimaPlugin)

lazy val `quill-jasync` =
(project in file("quill-jasync"))
.settings(commonSettings: _*)
.settings(
Test / fork := true,
libraryDependencies ++= Seq(
"com.github.jasync-sql" % "jasync-common" % "2.2.4",
"org.scala-lang.modules" %% "scala-java8-compat" % "0.9.1"
)
)
.dependsOn(`quill-sql` % "compile->compile;test->test")
.enablePlugins(MimaPlugin)

lazy val `quill-jasync-postgres` =
(project in file("quill-jasync-postgres"))
.settings(commonSettings: _*)
.settings(
Test / fork := true,
libraryDependencies ++= Seq(
"com.github.jasync-sql" % "jasync-postgresql" % "2.2.4"
)
)
.dependsOn(`quill-jasync` % "compile->compile;test->test")
.enablePlugins(MimaPlugin)

lazy val `quill-jasync-mysql` =
(project in file("quill-jasync-mysql"))
.settings(commonSettings: _*)
.settings(
Test / fork := true,
libraryDependencies ++= Seq(
"com.github.jasync-sql" % "jasync-mysql" % "2.2.4"
)
)
.dependsOn(`quill-jasync` % "compile->compile;test->test")
.enablePlugins(MimaPlugin)

lazy val `quill-jasync-zio` =
(project in file("quill-jasync-zio"))
.settings(commonSettings: _*)
.settings(
Test / fork := true,
libraryDependencies ++= Seq(
"com.github.jasync-sql" % "jasync-common" % "2.2.4",
"org.scala-lang.modules" %% "scala-java8-compat" % "0.9.1",
"dev.zio" %% "zio" % Version.zio,
"dev.zio" %% "zio-streams" % Version.zio
)
)
.dependsOn(`quill-zio` % "compile->compile;test->test")
.dependsOn(`quill-sql` % "compile->compile;test->test")
.enablePlugins(MimaPlugin)

lazy val `quill-jasync-zio-postgres` =
(project in file("quill-jasync-zio-postgres"))
.settings(commonSettings: _*)
.settings(
Test / fork := true,
libraryDependencies ++= Seq(
"com.github.jasync-sql" % "jasync-postgresql" % "2.2.4"
)
)
.dependsOn(`quill-jasync-zio` % "compile->compile;test->test")
.enablePlugins(MimaPlugin)

lazy val `quill-cassandra` =
(project in file("quill-cassandra"))
.settings(commonSettings: _*)
Expand All @@ -514,7 +418,7 @@ lazy val `quill-cassandra` =
libraryDependencies ++= Seq(
"com.datastax.oss" % "java-driver-core" % "4.17.0",
(CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, 12)) => "org.scala-lang.modules" %% "scala-java8-compat" % "0.8.0"
case Some((2, 12)) => "org.scala-lang.modules" %% "scala-java8-compat" % "0.9.1"
case _ => "org.scala-lang.modules" %% "scala-java8-compat" % "1.0.2"
})
)
Expand Down Expand Up @@ -573,14 +477,14 @@ lazy val `quill-orientdb` =

lazy val jdbcTestingLibraries = Seq(
libraryDependencies ++= Seq(
"com.zaxxer" % "HikariCP" % "4.0.3" exclude ("org.slf4j", "*"),
"com.mysql" % "mysql-connector-j" % "8.1.0" % Test,
"com.h2database" % "h2" % "2.2.224" % Test,
"org.postgresql" % "postgresql" % "42.6.0" % Test,
"org.xerial" % "sqlite-jdbc" % "3.42.0.1" % Test,
"com.microsoft.sqlserver" % "mssql-jdbc" % "7.2.2.jre8" % Test,
"com.oracle.ojdbc" % "ojdbc8" % "19.3.0.0" % Test,
"org.mockito" %% "mockito-scala-scalatest" % "1.17.14" % Test
"com.zaxxer" % "HikariCP" % "5.0.1" exclude ("org.slf4j", "*"),
"com.mysql" % "mysql-connector-j" % "8.1.0" % Test,
"com.h2database" % "h2" % "2.2.224" % Test,
"org.postgresql" % "postgresql" % "42.6.0" % Test,
"org.xerial" % "sqlite-jdbc" % "3.42.0.1" % Test,
"com.microsoft.sqlserver" % "mssql-jdbc" % "7.4.1.jre11" % Test,
"com.oracle.ojdbc" % "ojdbc8" % "19.3.0.0" % Test,
"org.mockito" %% "mockito-scala-scalatest" % "1.17.14" % Test
)
)

Expand All @@ -592,7 +496,7 @@ lazy val excludeFilterSettings = Seq(

excludeTests match {
case ExcludeTests.Include =>
excludePaths(List())
excludePaths(List.empty)
case _ =>
excludePaths(paths)
}
Expand Down Expand Up @@ -647,7 +551,7 @@ val scalaCollectionCompatVersion = "2.11.0"

lazy val loggingSettings = Seq(
libraryDependencies ++= Seq(
"ch.qos.logback" % "logback-classic" % "1.3.11" % Test
"ch.qos.logback" % "logback-classic" % "1.4.11" % Test
)
)

Expand All @@ -671,8 +575,9 @@ lazy val basicSettings = excludeFilterSettings ++ Seq(
Test / unmanagedClasspath ++= Seq(
baseDirectory.value / "src" / "test" / "resources"
),
javacOptions := Seq("-source", "11", "-target", "11"),
scalacOptions ++= Seq(
"-release:8",
"-release:11",
"-encoding",
"UTF-8",
"-feature",
Expand Down
2 changes: 1 addition & 1 deletion build/Dockerfile-sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM hseeberger/scala-sbt:8u312_1.5.5_2.13.6
FROM sbtscala/scala-sbt:eclipse-temurin-focal-17.0.8.1_1_1.9.6_3.3.1
MAINTAINER mdedetrich@gmail.com

RUN apt-get update
Expand Down
24 changes: 3 additions & 21 deletions build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export CASSANDRA_DC=datacenter1
export ORIENTDB_HOST=127.0.0.1
export ORIENTDB_PORT=12424

export JAVA_OPTS="-Dquill.macro.log=false -Dquill.scala.version=$SCALA_VERSION -Xms3g -Xmx3g -Xss5m -XX:ReservedCodeCacheSize=256m -XX:+TieredCompilation -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC"
export JAVA_OPTS="-Dquill.macro.log=false -Dquill.scala.version=$SCALA_VERSION -Xms3g -Xmx3g -Xss5m -XX:ReservedCodeCacheSize=256m -XX:+TieredCompilation"

modules=$1
echo "Start build modules: $modules"
Expand Down Expand Up @@ -164,34 +164,19 @@ function wait_for_bigdata() {

function base_build() {
echo "build.sh =:> Base Build Specified"
export JAVA_OPTS="-Dquill.macro.log=false -Dquill.scala.version=$SCALA_VERSION -Xms4g -Xmx4g -Xss10m -XX:ReservedCodeCacheSize=256m -XX:+TieredCompilation -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC"
export JAVA_OPTS="-Dquill.macro.log=false -Dquill.scala.version=$SCALA_VERSION -Xms4g -Xmx4g -Xss10m -XX:ReservedCodeCacheSize=256m -XX:+TieredCompilation "
echo "build.sh =:> Starting Base Build Primary"
sbt "sbt -Dmodules=base $SBT_ARGS test"
}

function db_build() {
echo "build.sh =:> DB Build Specified"
wait_for_databases
export JAVA_OPTS="-Dquill.macro.log=false -Dquill.scala.version=$SCALA_VERSION -Xms4g -Xmx4g -Xss10m -XX:ReservedCodeCacheSize=256m -XX:+TieredCompilation -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC"
export JAVA_OPTS="-Dquill.macro.log=false -Dquill.scala.version=$SCALA_VERSION -Xms4g -Xmx4g -Xss10m -XX:ReservedCodeCacheSize=256m -XX:+TieredCompilation "
echo "build.sh =:> Starting DB Build Primary"
./build/aware_run.sh "sbt -Dmodules=db $SBT_ARGS test"
}

function js_build() {
echo "build.sh =:> JS Build Specified"
show_mem
export JAVA_OPTS="-Dquill.macro.log=false -Dquill.scala.version=$SCALA_VERSION -Xms4g -Xmx4g -Xss10m -XX:ReservedCodeCacheSize=256m -XX:+TieredCompilation -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC"
echo "build.sh =:> Starting JS Build Primary"
sbt -Dmodules=js $SBT_ARGS test
}

function async_build() {
echo "build.sh =:> Async Build Specified"
wait_for_mysql_postgres
echo "build.sh =:> Starting Async Build Primary"
sbt -Dmodules=async $SBT_ARGS test
}

function codegen_build() {
echo "build.sh =:> Codegen Build Specified"
wait_for_databases
Expand Down Expand Up @@ -244,9 +229,6 @@ elif [[ $modules == "js" ]]; then
elif [[ $modules == "finagle" ]]; then
echo "build.sh =:> Build Script: Doing Finagle Database Build"
finagle_build
elif [[ $modules == "async" ]]; then
echo "build.sh =:> Build Script: Doing Async Database Build"
async_build
elif [[ $modules == "codegen" ]]; then
echo "build.sh =:> Build Script: Doing Code Generator Build"
codegen_build
Expand Down
2 changes: 1 addition & 1 deletion docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ docker-compose run --rm sbt sbt "test-only io.getquill.context.sql.SqlQuerySpec"

Run all tests in specific sub-project:
```bash
docker-compose run --rm sbt sbt "project quill-async" test
docker-compose run --rm sbt sbt "project quill-jdbc-zio" test
```

Run specific test in specific sub-project:
Expand Down
Loading

0 comments on commit 272c5f3

Please sign in to comment.