Skip to content

Commit

Permalink
Drop Java 8 support (#364)
Browse files Browse the repository at this point in the history
* Drop Java 8 support

* Drop Java 8 support

* fail-fast: false

* fix tests

* fix tests

* Try fix OOM in CI

* Rollback doobie update

* Update sbt Docker image

* Try fix OOM

* Try fix OOM

* Try fix OOM

* Fix test
  • Loading branch information
guizmaii committed Oct 1, 2023
1 parent 1e71aef commit c8731e6
Show file tree
Hide file tree
Showing 13 changed files with 62 additions and 271 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,18 @@ 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
JAVA_OPTS: -Xms6G -Xmx6G -XX:+UseG1GC -XX:ReservedCodeCacheSize=256m -XX:+TieredCompilation -Dcommunity=false -Dquill.macro.log=false --add-exports java.base/sun.nio.ch=ALL-UNNAMED
JDK_JAVA_OPTIONS: -Xms6G -Xmx6G -XX:+UseG1GC -XX:ReservedCodeCacheSize=256m -XX:+TieredCompilation -Dcommunity=false -Dquill.macro.log=false --add-exports java.base/sun.nio.ch=ALL-UNNAMED

jobs:
build:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
scala: [ 3.3.1 ]
module: [ sqltest, db, async, bigdata ]
Expand All @@ -27,7 +31,7 @@ jobs:
uses: actions/setup-java@v3.13.0
with:
distribution: temurin
java-version: '8'
java-version: '17'
check-latest: true

- name: Scala ${{ matrix.scala }} Building ${{ matrix.module }}
Expand All @@ -47,7 +51,7 @@ jobs:
uses: actions/setup-java@v3.13.0
with:
distribution: temurin
java-version: '8'
java-version: '17'
check-latest: true
- run: sbt ci-release
env:
Expand Down
219 changes: 0 additions & 219 deletions .travis.yml

This file was deleted.

18 changes: 10 additions & 8 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ val isCommunityRemoteBuild =
sys.props.getOrElse("communityRemote", "false").toBoolean

lazy val scalatestVersion =
if (isCommunityRemoteBuild) "3.2.7" else "3.2.9"
if (isCommunityRemoteBuild) "3.2.7" else "3.2.17"

lazy val baseModules = Seq[sbt.ClasspathDep[sbt.ProjectReference]](
`quill-sql`
Expand Down Expand Up @@ -123,7 +123,7 @@ lazy val `quill-sql` =
// errors will happen. Even if the pprint classes are actually there
"io.suzaku" %% "boopickle" % "1.4.0",
"com.lihaoyi" %% "pprint" % "0.8.1",
"ch.qos.logback" % "logback-classic" % "1.3.11" % Test,
"ch.qos.logback" % "logback-classic" % "1.4.11" % Test,
"io.getquill" %% "quill-engine" % zioQuillVersion,
"dev.zio" %% "zio" % "2.0.18",
("io.getquill" %% "quill-util" % zioQuillVersion)
Expand Down Expand Up @@ -203,12 +203,12 @@ lazy val `quill-caliban` =
"com.github.ghostdogpr" %% "caliban-zio-http" % "2.0.2",
// Adding this to main dependencies would force users to use logback-classic for SLF4j unless the specifically remove it
// seems to be safer to just exclude & add a commented about need for a SLF4j implementation in Docs.
"ch.qos.logback" % "logback-classic" % "1.3.11" % Test,
"ch.qos.logback" % "logback-classic" % "1.4.11" % Test,
"io.d11" %% "zhttp" % "2.0.0-RC11" % Test,
// Don't want to make this dependant on zio-test for the testing code so importing this here separately
"org.scalatest" %% "scalatest" % scalatestVersion % Test,
"org.scalatest" %% "scalatest-mustmatchers" % scalatestVersion % Test,
"org.postgresql" % "postgresql" % "42.2.27" % Test,
"org.postgresql" % "postgresql" % "42.6.0" % Test,
)
)
.dependsOn(`quill-jdbc-zio` % "compile->compile")
Expand Down Expand Up @@ -294,15 +294,15 @@ lazy val commonSettings =
lazy val jdbcTestingLibraries = Seq(
// JDBC Libraries for testing of quill-jdbc___ contexts
libraryDependencies ++= Seq(
"com.zaxxer" % "HikariCP" % "4.0.3" exclude("org.slf4j", "*"),
"com.zaxxer" % "HikariCP" % "5.0.1" exclude("org.slf4j", "*"),
// In 8.0.22 error happens: Conversion from java.time.OffsetDateTime to TIMESTAMP is not supported
"com.mysql" % "mysql-connector-j" % "8.1.0" % Test,
"com.h2database" % "h2" % "2.2.224" % Test,
// In 42.2.18 error happens: PSQLException: conversion to class java.time.OffsetTime from timetz not supported
"org.postgresql" % "postgresql" % "42.6.0" % Test,
"org.xerial" % "sqlite-jdbc" % "3.42.0.1" % Test,
// In 7.1.1-jre8-preview error happens: The conversion to class java.time.OffsetDateTime is unsupported.
"com.microsoft.sqlserver" % "mssql-jdbc" % "7.2.2.jre8" % Test,
"com.microsoft.sqlserver" % "mssql-jdbc" % "7.2.2.jre11" % Test,
"com.oracle.ojdbc" % "ojdbc8" % "19.3.0.0" % Test,
//"org.mockito" %% "mockito-scala-scalatest" % "1.16.2" % Test
)
Expand Down Expand Up @@ -332,6 +332,8 @@ lazy val basicSettings = Seq(
scalacOptions ++= Seq(
"-language:implicitConversions", "-explain",
// See https://docs.scala-lang.org/scala3/guides/migration/tooling-syntax-rewriting.html
"-no-indent"
)
"-no-indent",
"-release:11",
),
javacOptions := Seq("-source", "11", "-target", "11"),
)
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
11 changes: 0 additions & 11 deletions build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ export CASSANDRA_DC=datacenter1
export ORIENTDB_HOST=127.0.0.1
export ORIENTDB_PORT=12424

export GC_OPTS="-XX:ReservedCodeCacheSize=256m -XX:+TieredCompilation -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled"
export JVM_OPTS="-Dcommunity=false -Dquill.macro.log=false -Xms1024m -Xmx4g -Xss5m ${GC_OPTS}"

modules=$1

echo "Modules: $modules"
Expand Down Expand Up @@ -168,8 +165,6 @@ function base_build() {
}

function sqltest_build() {
# Can use more memory here since not loading any images
export JVM_OPTS="-Dcommunity=false -Dquill.macro.log=false -Xms2g -Xmx5g -Xss5m ${GC_OPTS}"
sbt -Dmodules=sqltest -Doracle=true $SBT_ARGS test
}

Expand All @@ -180,12 +175,6 @@ function db_build() {
./build/aware_run.sh "sbt -Dmodules=db $SBT_ARGS test"
}

# function js_build() {
# show_mem
# export JVM_OPTS="-Dquill.macro.log=false -Xms1024m -Xmx4g -Xss5m ${GC_OPTS}"
# sbt -Dmodules=js $SBT_ARGS test
# }

function async_build() {
wait_for_mysql_postgres
sbt -Dmodules=async $SBT_ARGS test
Expand Down
2 changes: 1 addition & 1 deletion build/m1/Dockerfile-sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=linux/arm64 hseeberger/scala-sbt:8u312_1.5.5_2.13.6
FROM --platform=linux/arm64 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
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ services:
- ~/.m2:/root/.m2:cached
- ~/.sbt:/root/.sbt:cached
environment:
- SBT_OPTS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 -Dfile.encoding=UTF-8 -Xms512m -Xmx1536m -Xss2m -XX:ReservedCodeCacheSize=256m -XX:+TieredCompilation -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC
- SBT_OPTS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 -Dfile.encoding=UTF-8 -Xms512m -Xmx1536m -Xss2m -XX:ReservedCodeCacheSize=256m -XX:+TieredCompilation
- POSTGRES_HOST=postgres
- POSTGRES_PORT=5432
- MYSQL_HOST=mysql
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package io.getquill.context.cassandra

import java.util.{ Date, UUID }
import java.time.{ Instant, LocalDate }
import io.getquill._
import java.util.{Date, UUID}
import java.time.{Instant, LocalDate}
import io.getquill.*

import java.time.temporal.ChronoUnit

class ListsEncodingSpec extends CollectionsSpec {

Expand All @@ -26,7 +28,9 @@ class ListsEncodingSpec extends CollectionsSpec {
)
val e = ListsEntity(1, List("c"), List(BigDecimal(1.33)), List(true), List(0, 1), List(3, 2), List(1, 2), List(2, 3),
List(1f, 3f), List(5d), List(LocalDate.now()),
List(Instant.now()), List(UUID.randomUUID()))
List(Instant.now().truncatedTo(ChronoUnit.MILLIS)),
List(UUID.randomUUID())
)

inline def q = quote(query[ListsEntity])
val qDynamic = quote(query[ListsEntity])
Expand Down
Loading

0 comments on commit c8731e6

Please sign in to comment.