Skip to content

Commit

Permalink
Merge branch 'main' into read-timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
mpilquist committed Nov 24, 2022
2 parents 741c556 + 5429a06 commit 2e7a7be
Show file tree
Hide file tree
Showing 29 changed files with 1,893 additions and 206 deletions.
96 changes: 67 additions & 29 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ jobs:
name: Build and Test
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.12.16, 2.13.8, 3.1.3]
os: [ubuntu-22.04]
scala: [2.12.17, 2.13.10, 3.2.1]
java: [temurin@11]
project: [rootJS, rootJVM]
project: [rootJS, rootJVM, rootNative]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
Expand Down Expand Up @@ -66,6 +66,10 @@ jobs:
~/Library/Caches/Coursier/v1
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}

- name: Install brew formulae (ubuntu)
if: (matrix.project == 'rootNative') && startsWith(matrix.os, 'ubuntu')
run: /home/linuxbrew/.linuxbrew/bin/brew install s2n utf8proc

- name: Set up cert permissions
run: |
chmod 600 world/server.key
Expand All @@ -88,6 +92,10 @@ jobs:
if: matrix.project == 'rootJS'
run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' Test/scalaJSLinkerResult

- name: nativeLink
if: matrix.project == 'rootNative'
run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' Test/nativeLink

- name: Test
run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' test

Expand All @@ -99,17 +107,17 @@ jobs:
if: matrix.java == 'temurin@11'
run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' doc

- name: Check Doc Site (2.13.8 JVM only)
if: matrix.scala == '2.13.8' && matrix.project == 'rootJVM'
- name: Check Doc Site (2.13.10 JVM only)
if: matrix.scala == '2.13.10' && matrix.project == 'rootJVM'
run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' docs/makeSite

- name: Make target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
run: mkdir -p modules/circe/.jvm/target target .js/target modules/docs/target modules/core/js/target modules/circe/.js/target modules/core/jvm/target modules/tests/js/target .jvm/target .native/target modules/refined/.js/target modules/refined/.jvm/target modules/tests/jvm/target modules/example/target project/target
run: mkdir -p modules/circe/.jvm/target target .js/target modules/core/native/target modules/docs/target modules/core/js/target modules/circe/.js/target modules/core/jvm/target modules/tests/js/target modules/refined/.native/target .jvm/target .native/target modules/refined/.js/target modules/refined/.jvm/target modules/circe/.native/target modules/tests/jvm/target modules/example/target modules/tests/native/target project/target

- name: Compress target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
run: tar cf targets.tar modules/circe/.jvm/target target .js/target modules/docs/target modules/core/js/target modules/circe/.js/target modules/core/jvm/target modules/tests/js/target .jvm/target .native/target modules/refined/.js/target modules/refined/.jvm/target modules/tests/jvm/target modules/example/target project/target
run: tar cf targets.tar modules/circe/.jvm/target target .js/target modules/core/native/target modules/docs/target modules/core/js/target modules/circe/.js/target modules/core/jvm/target modules/tests/js/target modules/refined/.native/target .jvm/target .native/target modules/refined/.js/target modules/refined/.jvm/target modules/circe/.native/target modules/tests/jvm/target modules/example/target modules/tests/native/target project/target

- name: Upload target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
Expand All @@ -124,8 +132,8 @@ jobs:
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.13.8]
os: [ubuntu-22.04]
scala: [2.13.10]
java: [temurin@11]
runs-on: ${{ matrix.os }}
steps:
Expand Down Expand Up @@ -162,62 +170,92 @@ jobs:
~/Library/Caches/Coursier/v1
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}

- name: Download target directories (2.12.16, rootJS)
- name: Download target directories (2.12.17, rootJS)
uses: actions/download-artifact@v2
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.17-rootJS

- name: Inflate target directories (2.12.17, rootJS)
run: |
tar xf targets.tar
rm targets.tar
- name: Download target directories (2.12.17, rootJVM)
uses: actions/download-artifact@v2
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.17-rootJVM

- name: Inflate target directories (2.12.17, rootJVM)
run: |
tar xf targets.tar
rm targets.tar
- name: Download target directories (2.12.17, rootNative)
uses: actions/download-artifact@v2
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.17-rootNative

- name: Inflate target directories (2.12.17, rootNative)
run: |
tar xf targets.tar
rm targets.tar
- name: Download target directories (2.13.10, rootJS)
uses: actions/download-artifact@v2
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.16-rootJS
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.10-rootJS

- name: Inflate target directories (2.12.16, rootJS)
- name: Inflate target directories (2.13.10, rootJS)
run: |
tar xf targets.tar
rm targets.tar
- name: Download target directories (2.12.16, rootJVM)
- name: Download target directories (2.13.10, rootJVM)
uses: actions/download-artifact@v2
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.16-rootJVM
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.10-rootJVM

- name: Inflate target directories (2.12.16, rootJVM)
- name: Inflate target directories (2.13.10, rootJVM)
run: |
tar xf targets.tar
rm targets.tar
- name: Download target directories (2.13.8, rootJS)
- name: Download target directories (2.13.10, rootNative)
uses: actions/download-artifact@v2
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.8-rootJS
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.10-rootNative

- name: Inflate target directories (2.13.8, rootJS)
- name: Inflate target directories (2.13.10, rootNative)
run: |
tar xf targets.tar
rm targets.tar
- name: Download target directories (2.13.8, rootJVM)
- name: Download target directories (3.2.1, rootJS)
uses: actions/download-artifact@v2
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.8-rootJVM
name: target-${{ matrix.os }}-${{ matrix.java }}-3.2.1-rootJS

- name: Inflate target directories (2.13.8, rootJVM)
- name: Inflate target directories (3.2.1, rootJS)
run: |
tar xf targets.tar
rm targets.tar
- name: Download target directories (3.1.3, rootJS)
- name: Download target directories (3.2.1, rootJVM)
uses: actions/download-artifact@v2
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-3.1.3-rootJS
name: target-${{ matrix.os }}-${{ matrix.java }}-3.2.1-rootJVM

- name: Inflate target directories (3.1.3, rootJS)
- name: Inflate target directories (3.2.1, rootJVM)
run: |
tar xf targets.tar
rm targets.tar
- name: Download target directories (3.1.3, rootJVM)
- name: Download target directories (3.2.1, rootNative)
uses: actions/download-artifact@v2
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-3.1.3-rootJVM
name: target-${{ matrix.os }}-${{ matrix.java }}-3.2.1-rootNative

- name: Inflate target directories (3.1.3, rootJVM)
- name: Inflate target directories (3.2.1, rootNative)
run: |
tar xf targets.tar
rm targets.tar
Expand All @@ -237,11 +275,11 @@ jobs:
run: sbt '++${{ matrix.scala }}' tlRelease

coverage:
name: Generate coverage report (2.13.8 JVM only)
name: Generate coverage report (2.13.10 JVM only)
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.13.8]
scala: [2.13.10]
java: [temurin@11]
runs-on: ${{ matrix.os }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
version = "3.5.9"
version = "3.6.1"
runner.dialect = Scala213Source3
project.includePaths = [] # disables formatting
97 changes: 43 additions & 54 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
ThisBuild / tlBaseVersion := "0.4"

// Our Scala versions.
lazy val `scala-2.12` = "2.12.16"
lazy val `scala-2.13` = "2.13.8"
lazy val `scala-3.0` = "3.1.3"
lazy val `scala-2.12` = "2.12.17"
lazy val `scala-2.13` = "2.13.10"
lazy val `scala-3.0` = "3.2.1"

ThisBuild / scalaVersion := `scala-2.13`
ThisBuild / crossScalaVersions :=
Expand All @@ -17,9 +17,13 @@ ThisBuild / developers := List(

ThisBuild / tlCiReleaseBranches := Seq("main") // publish snapshits on `main`
ThisBuild / tlSonatypeUseLegacyHost := false
ThisBuild / githubWorkflowOSes := Seq("ubuntu-22.04")
ThisBuild / githubWorkflowJavaVersions := Seq(JavaSpec.temurin("11"))
ThisBuild / tlJdkRelease := Some(8)

ThisBuild / githubWorkflowBuildPreamble ++= nativeBrewInstallWorkflowSteps.value
ThisBuild / nativeBrewInstallCond := Some("matrix.project == 'rootNative'")

lazy val setupCertAndDocker = Seq(
WorkflowStep.Run(
commands = List("chmod 600 world/server.key", "sudo chown 999 world/server.key"),
Expand Down Expand Up @@ -69,8 +73,8 @@ ThisBuild / libraryDependencySchemes ++= Seq(
)

// This is used in a couple places
lazy val fs2Version = "3.2.14"
lazy val natchezVersion = "0.1.6"
lazy val fs2Version = "3.4.0"
lazy val natchezVersion = "0.2.2"

// Global Settings
lazy val commonSettings = Seq(
Expand All @@ -97,45 +101,21 @@ lazy val commonSettings = Seq(
"-sourcepath", (LocalRootProject / baseDirectory).value.getAbsolutePath,
"-doc-source-url", "https://github.com/tpolecat/skunk/blob/v" + version.value + "€{FILE_PATH}.scala",
),
libraryDependencies ++= Seq(
compilerPlugin("org.typelevel" %% "kind-projector" % "0.13.2" cross CrossVersion.full),
).filterNot(_ => tlIsScala3.value),

// Coverage Exclusions
coverageExcludedPackages := "ffstest.*;tests.*;example.*;natchez.http4s.*",

// uncomment in case of emergency
// scalacOptions ++= { if (scalaVersion.value.startsWith("3.")) Seq("-source:3.0-migration") else Nil },

// Add some more source directories
Compile / unmanagedSourceDirectories ++= {
val sourceDir = (Compile / sourceDirectory).value
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((3, _)) => Seq(sourceDir / "scala-2.13+", file(sourceDir.getPath.replaceFirst("jvm", "shared").replaceFirst("js", "shared")) / "scala-2.13+")
case Some((2, 12)) => Seq()
case Some((2, _)) => Seq(sourceDir / "scala-2.13+", file(sourceDir.getPath.replaceFirst("jvm", "shared").replaceFirst("js", "shared")) / "scala-2.13+")
case _ => Seq()
}
},


// dottydoc really doesn't work at all right now
Compile / doc / sources := {
val old = (Compile / doc / sources).value
if (scalaVersion.value.startsWith("3."))
Seq()
else
old
},

)

lazy val skunk = tlCrossRootProject
.settings(name := "skunk")
.aggregate(core, tests, circe, refined, example)
.settings(commonSettings)

lazy val core = crossProject(JVMPlatform, JSPlatform)
lazy val core = crossProject(JVMPlatform, JSPlatform, NativePlatform)
.crossType(CrossType.Full)
.in(file("modules/core"))
.enablePlugins(AutomateHeaderPlugin)
Expand All @@ -145,42 +125,46 @@ lazy val core = crossProject(JVMPlatform, JSPlatform)
description := "Tagless, non-blocking data access library for Postgres.",
scalacOptions ~= (_.filterNot(_ == "-source:3.0-migration")),
libraryDependencies ++= Seq(
"org.typelevel" %%% "cats-core" % "2.8.0",
"org.typelevel" %%% "cats-effect" % "3.3.14",
"org.typelevel" %%% "cats-core" % "2.9.0",
"org.typelevel" %%% "cats-effect" % "3.4.1",
"co.fs2" %%% "fs2-core" % fs2Version,
"co.fs2" %%% "fs2-io" % fs2Version,
"org.scodec" %%% "scodec-bits" % "1.1.34",
"org.scodec" %%% "scodec-core" % (if (tlIsScala3.value) "2.2.0" else "1.11.10"),
"org.scodec" %%% "scodec-cats" % "1.2.0",
"org.tpolecat" %%% "natchez-core" % natchezVersion,
"org.tpolecat" %%% "sourcepos" % "1.0.1",
"org.tpolecat" %%% "sourcepos" % "1.1.0",
"org.scala-lang.modules" %%% "scala-collection-compat" % "2.8.1",
) ++ Seq(
"com.beachape" %%% "enumeratum" % "1.6.1",
).filterNot(_ => tlIsScala3.value)
)
).jvmSettings(
libraryDependencies += "com.ongres.scram" % "client" % "2.1",
).jsSettings(
)
.platformsSettings(JVMPlatform, JSPlatform)(
libraryDependencies ++= Seq(
"com.beachape" %%% "enumeratum" % "1.6.1",
).filterNot(_ => tlIsScala3.value)
)
.platformsSettings(JSPlatform, NativePlatform)(
libraryDependencies ++= Seq(
"com.armanbilge" %%% "saslprep" % "0.1.1",
"io.github.cquiroz" %%% "scala-java-time" % "2.4.0",
"io.github.cquiroz" %%% "locales-minimal-en_us-db" % "1.4.1"
"io.github.cquiroz" %%% "locales-minimal-en_us-db" % "1.5.0"
),
)

lazy val refined = crossProject(JVMPlatform, JSPlatform)
lazy val refined = crossProject(JVMPlatform, JSPlatform, NativePlatform)
.crossType(CrossType.Pure)
.in(file("modules/refined"))
.dependsOn(core)
.enablePlugins(AutomateHeaderPlugin)
.settings(commonSettings)
.settings(
libraryDependencies ++= Seq(
"eu.timepit" %%% "refined" % "0.9.29",
"eu.timepit" %%% "refined" % "0.10.1",
)
)

lazy val circe = crossProject(JVMPlatform, JSPlatform)
lazy val circe = crossProject(JVMPlatform, JSPlatform, NativePlatform)
.crossType(CrossType.Pure)
.in(file("modules/circe"))
.dependsOn(core)
Expand All @@ -189,12 +173,12 @@ lazy val circe = crossProject(JVMPlatform, JSPlatform)
.settings(
name := "skunk-circe",
libraryDependencies ++= Seq(
"io.circe" %%% "circe-core" % "0.14.2",
"io.circe" %%% "circe-parser" % "0.14.2"
"io.circe" %%% "circe-core" % "0.14.3",
"io.circe" %%% "circe-parser" % "0.14.3"
)
)

lazy val tests = crossProject(JVMPlatform, JSPlatform)
lazy val tests = crossProject(JVMPlatform, JSPlatform, NativePlatform)
.crossType(CrossType.Full)
.in(file("modules/tests"))
.dependsOn(core, circe)
Expand All @@ -203,21 +187,26 @@ lazy val tests = crossProject(JVMPlatform, JSPlatform)
.settings(
scalacOptions -= "-Xfatal-warnings",
libraryDependencies ++= Seq(
"org.scalameta" %%% "munit" % "0.7.29",
"org.scalameta" % "junit-interface" % "0.7.29",
"org.typelevel" %%% "scalacheck-effect-munit" % "1.0.4",
"org.typelevel" %%% "munit-cats-effect-3" % "1.0.7",
"org.typelevel" %%% "cats-free" % "2.8.0",
"org.typelevel" %%% "cats-laws" % "2.8.0",
"org.typelevel" %%% "discipline-munit" % "1.0.9",
) ++ Seq(
"io.chrisdavenport" %%% "cats-time" % "0.3.4",
).filterNot(_ => scalaVersion.value.startsWith("3.")),
"org.scalameta" %%% "munit" % "1.0.0-M6",
"org.scalameta" % "junit-interface" % "1.0.0-M6",
"org.typelevel" %%% "scalacheck-effect-munit" % "2.0.0-M2",
"org.typelevel" %%% "munit-cats-effect" % "2.0.0-M3",
"org.typelevel" %%% "cats-free" % "2.9.0",
"org.typelevel" %%% "cats-laws" % "2.9.0",
"org.typelevel" %%% "discipline-munit" % "2.0.0-M3",
"org.typelevel" %%% "cats-time" % "0.5.1",
),
testFrameworks += new TestFramework("munit.Framework")
)
.jsSettings(
Test / scalaJSLinkerConfig ~= (_.withModuleKind(ModuleKind.CommonJSModule)),
)
.nativeEnablePlugins(ScalaNativeBrewedConfigPlugin)
.nativeSettings(
libraryDependencies += "com.armanbilge" %%% "epollcat" % "0.0-ab1026e",
Test / nativeBrewFormulas ++= Set("s2n", "utf8proc"),
Test / envVars ++= Map("S2N_DONT_MLOCK" -> "1")
)

lazy val example = project
.in(file("modules/example"))
Expand Down
Loading

0 comments on commit 2e7a7be

Please sign in to comment.