Skip to content
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
12 changes: 8 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ permissions:

jobs:
test:
runs-on: self-hosted
# runs-on: ubuntu-latest
# runs-on: self-hosted
runs-on: ubuntu-latest
env:
# define Java options for both official sbt and sbt-extras
JAVA_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8
Expand All @@ -38,12 +38,14 @@ jobs:
java-version: '8'
distribution: 'temurin'
# cache: 'sbt'
- name: Setup sbt launcher
uses: sbt/setup-sbt@v1
- name: Run tests & Coverage Report
run: sbt coverage test coverageReport
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: common/target/scala-2.12/coverage-report/cobertura.xml,core/target/scala-2.12/coverage-report/cobertura.xml,teskit/target/scala-2.12/coverage-report/cobertura.xml
files: common/target/scala-2.12/coverage-report/cobertura.xml,common/testkit/target/scala-2.12/coverage-report/cobertura.xml,core/target/scala-2.12/coverage-report/cobertura.xml,core/teskit/target/scala-2.12/coverage-report/cobertura.xml,jdbc/target/scala-2.12/coverage-report/cobertura.xml,jdbc/teskit/target/scala-2.12/coverage-report/cobertura.xml,counter/target/scala-2.12/coverage-report/cobertura.xml,kv/target/scala-2.12/coverage-report/cobertura.xml,kv/target/scala-2.12/coverage-report/cobertura.xml,session/testkit/target/scala-2.12/coverage-report/cobertura.xml
flags: unittests
fail_ci_if_error: true
verbose: true
Expand All @@ -59,5 +61,7 @@ jobs:
java-version: '8'
distribution: 'temurin'
# cache: 'sbt'
- name: Setup sbt launcher
uses: sbt/setup-sbt@v1
- name: Formatting
run: sbt scalafmtSbtCheck scalafmtCheck test:scalafmtCheck
run: sbt scalafmtSbtCheck scalafmtCheck Test/scalafmtCheck
14 changes: 9 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ permissions:

jobs:
release:
runs-on: self-hosted
# runs-on: ubuntu-latest
# runs-on: self-hosted
runs-on: ubuntu-latest
env:
# define Java options for both official sbt and sbt-extras
JAVA_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8
Expand All @@ -35,17 +35,19 @@ jobs:
java-version: '8'
distribution: 'temurin'
# cache: 'sbt'
- name: Setup sbt launcher
uses: sbt/setup-sbt@v1
- name: Run tests & Coverage Report
run: sbt coverage test coverageReport coverageAggregate
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: common/target/scala-2.12/coverage-report/cobertura.xml,common/testkit/target/scala-2.12/coverage-report/cobertura.xml,core/target/scala-2.12/coverage-report/cobertura.xml,core/teskit/target/scala-2.12/coverage-report/cobertura.xml,jdbc/target/scala-2.12/coverage-report/cobertura.xml,jdbc/teskit/target/scala-2.12/coverage-report/cobertura.xml,elastic/target/scala-2.12/coverage-report/cobertura.xml,elastic/teskit/target/scala-2.12/coverage-report/cobertura.xml,counter/target/scala-2.12/coverage-report/cobertura.xml,server/testkit/target/scala-2.12/coverage-report/cobertura.xml,session/testkit/target/scala-2.12/coverage-report/cobertura.xml
files: common/target/scala-2.12/coverage-report/cobertura.xml,common/testkit/target/scala-2.12/coverage-report/cobertura.xml,core/target/scala-2.12/coverage-report/cobertura.xml,core/teskit/target/scala-2.12/coverage-report/cobertura.xml,jdbc/target/scala-2.12/coverage-report/cobertura.xml,jdbc/teskit/target/scala-2.12/coverage-report/cobertura.xml,counter/target/scala-2.12/coverage-report/cobertura.xml,kv/target/scala-2.12/coverage-report/cobertura.xml,kv/target/scala-2.12/coverage-report/cobertura.xml,session/testkit/target/scala-2.12/coverage-report/cobertura.xml
flags: unittests
fail_ci_if_error: false
verbose: true
- name: Publish
run: sbt publish
run: sbt + publish

lint:
runs-on: ubuntu-latest
Expand All @@ -58,5 +60,7 @@ jobs:
java-version: '8'
distribution: 'temurin'
# cache: 'sbt'
- name: Setup sbt launcher
uses: sbt/setup-sbt@v1
- name: Formatting
run: sbt scalafmtSbtCheck scalafmtCheck test:scalafmtCheck
run: sbt scalafmtSbtCheck scalafmtCheck Test/scalafmtCheck
138 changes: 93 additions & 45 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,37 @@ import app.softnetwork.*
// Defaults
/////////////////////////////////

lazy val scala212 = "2.12.20"
lazy val scala213 = "2.13.16"
lazy val javacCompilerVersion = "1.8"
lazy val scalacCompilerOptions = Seq(
"-deprecation",
"-feature",
s"-target:jvm-$javacCompilerVersion"
)

ThisBuild / organization := "app.softnetwork"

name := "generic-persistence-api"

ThisBuild / version := "0.7.3"
ThisBuild / version := "0.8-SNAPSHOT"

lazy val moduleSettings = Seq(
crossScalaVersions := Seq(scala212, scala213),
scalacOptions ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, 12)) => scalacCompilerOptions :+ "-Ypartial-unification"
case Some((2, 13)) => scalacCompilerOptions
case _ => Seq.empty
}
}
)

ThisBuild / scalaVersion := "2.12.18"
ThisBuild / javacOptions ++= Seq("-source", javacCompilerVersion, "-target", javacCompilerVersion)

ThisBuild / scalacOptions ++= Seq("-deprecation", "-feature", "-target:jvm-1.8", "-Ypartial-unification")
ThisBuild / scalaVersion := scala212

ThisBuild / javacOptions ++= Seq("-source", "1.8", "-target", "1.8")
//ThisBuild / versionScheme := Some("early-semver")

ThisBuild / resolvers ++= Seq(
"Softnetwork Server" at "https://softnetwork.jfrog.io/artifactory/releases/",
Expand All @@ -24,35 +44,54 @@ ThisBuild / resolvers ++= Seq(

ThisBuild / libraryDependencies ++= Seq(
"com.thesamet.scalapb" %% "scalapb-runtime" % scalapb.compiler.Version.scalapbVersion % "protobuf",
"org.scala-lang.modules" %% "scala-parser-combinators" % "1.1.1"
"org.scala-lang.modules" %% "scala-parser-combinators" % "1.1.2"
)

ThisBuild / libraryDependencySchemes += "org.scala-lang.modules" %% "scala-xml" % VersionScheme.Always

ThisBuild / dependencyOverrides ++= Seq(
"com.github.jnr" % "jnr-ffi" % "2.2.17",
"com.github.jnr" % "jffi" % "1.3.13" classifier "native",
"org.lmdbjava" % "lmdbjava" % "0.9.1" exclude("org.slf4j", "slf4j-api"),
)

Test / parallelExecution := false

lazy val common = project.in(file("common"))
.configs(IntegrationTest)
.settings(Defaults.itSettings)
.settings(
Defaults.itSettings,
moduleSettings
)

lazy val commonTestkit = project.in(file("common/testkit"))
.configs(IntegrationTest)
.settings(Defaults.itSettings)
.settings(
Defaults.itSettings,
moduleSettings
)
.dependsOn(
common % "compile->compile;test->test;it->it"
)

lazy val core = project.in(file("core"))
.configs(IntegrationTest)
.enablePlugins(BuildInfoPlugin)
.settings(Defaults.itSettings, app.softnetwork.Info.infoSettings)
.settings(
Defaults.itSettings,
app.softnetwork.Info.infoSettings,
moduleSettings
)
.dependsOn(
common % "compile->compile;test->test;it->it"
)

lazy val coreTestkit = project.in(file("core/testkit"))
.configs(IntegrationTest)
.settings(Defaults.itSettings)
.settings(
Defaults.itSettings,
moduleSettings
)
.dependsOn(
core % "compile->compile;test->test;it->it"
)
Expand All @@ -62,15 +101,21 @@ lazy val coreTestkit = project.in(file("core/testkit"))

lazy val server = project.in(file("server"))
.configs(IntegrationTest)
.settings(Defaults.itSettings)
.settings(
Defaults.itSettings,
moduleSettings
)
.enablePlugins(AkkaGrpcPlugin)
.dependsOn(
core % "compile->compile;test->test;it->it"
)

lazy val serverTestkit = project.in(file("server/testkit"))
.configs(IntegrationTest)
.settings(Defaults.itSettings)
.settings(
Defaults.itSettings,
moduleSettings
)
.dependsOn(
server % "compile->compile;test->test;it->it"
)
Expand All @@ -80,22 +125,31 @@ lazy val serverTestkit = project.in(file("server/testkit"))

lazy val sessionCommon = project.in(file("session/common"))
.configs(IntegrationTest)
.settings(Defaults.itSettings)
.settings(
Defaults.itSettings,
moduleSettings
)
.enablePlugins(AkkaGrpcPlugin)
.dependsOn(
server % "compile->compile;test->test;it->it"
)

lazy val sessionCore = project.in(file("session/core"))
.configs(IntegrationTest)
.settings(Defaults.itSettings)
.settings(
Defaults.itSettings,
moduleSettings
)
.dependsOn(
sessionCommon % "compile->compile;test->test;it->it"
)

lazy val sessionTestkit = project.in(file("session/testkit"))
.configs(IntegrationTest)
.settings(Defaults.itSettings)
.settings(
Defaults.itSettings,
moduleSettings
)
.dependsOn(
sessionCore % "compile->compile;test->test;it->it"
)
Expand All @@ -105,14 +159,20 @@ lazy val sessionTestkit = project.in(file("session/testkit"))

lazy val jdbc = project.in(file("jdbc"))
.configs(IntegrationTest)
.settings(Defaults.itSettings)
.settings(
Defaults.itSettings,
moduleSettings
)
.dependsOn(
core % "compile->compile;test->test;it->it"
)

lazy val jdbcTestkit = project.in(file("jdbc/testkit"))
.configs(IntegrationTest)
.settings(Defaults.itSettings)
.settings(
Defaults.itSettings,
moduleSettings
)
.dependsOn(
jdbc % "compile->compile;test->test;it->it"
)
Expand All @@ -122,47 +182,33 @@ lazy val jdbcTestkit = project.in(file("jdbc/testkit"))

lazy val cassandra = project.in(file("cassandra"))
.configs(IntegrationTest)
.settings(Defaults.itSettings)
.settings(
Defaults.itSettings,
moduleSettings
)
.dependsOn(
core % "compile->compile;test->test;it->it"
)

lazy val counter = project.in(file("counter"))
.configs(IntegrationTest)
.settings(Defaults.itSettings)
.dependsOn(
core % "compile->compile;test->test;it->it"
.settings(
Defaults.itSettings,
moduleSettings
)
.dependsOn(
coreTestkit % "test->test;it->it"
)

lazy val elastic = project.in(file("elastic"))
.configs(IntegrationTest)
.settings(Defaults.itSettings)
.dependsOn(
core % "compile->compile;test->test;it->it"
)

lazy val elasticTestkit = project.in(file("elastic/testkit"))
.configs(IntegrationTest)
.settings(Defaults.itSettings)
.dependsOn(
elastic % "compile->compile;test->test;it->it"
)
.dependsOn(
commonTestkit % "compile->compile;test->test;it->it"
)
.dependsOn(
coreTestkit % "compile->compile;test->test;it->it"
)
.dependsOn(
jdbcTestkit % "compile->compile;test->test;it->it"
coreTestkit % "test->test;it->it"
)

lazy val kv = project.in(file("kv"))
.configs(IntegrationTest)
.settings(Defaults.itSettings)
.settings(
Defaults.itSettings,
moduleSettings
)
.enablePlugins(AkkaGrpcPlugin)
.dependsOn(
core % "compile->compile;test->test;it->it"
Expand All @@ -181,8 +227,6 @@ lazy val root = project.in(file("."))
jdbcTestkit,
// cassandra,
counter,
elastic,
elasticTestkit,
kv,
server,
serverTestkit,
Expand All @@ -191,7 +235,11 @@ lazy val root = project.in(file("."))
sessionTestkit
)
.configs(IntegrationTest)
.settings(Defaults.itSettings, Publish.noPublishSettings)
.settings(
Defaults.itSettings,
Publish.noPublishSettings,
crossScalaVersions := Nil
)

Test / envVars := Map(
"POSTGRES_USER" -> "admin",
Expand Down
16 changes: 12 additions & 4 deletions common/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,22 @@ val configDependencies = Seq(
)

val jackson = Seq(
"com.fasterxml.jackson.core" % "jackson-databind" % Versions.jackson,
"com.fasterxml.jackson.core" % "jackson-core" % Versions.jackson,
"com.fasterxml.jackson.core" % "jackson-annotations" % Versions.jackson,
"com.fasterxml.jackson.module" % "jackson-module-scala_2.12" % Versions.jackson
"com.fasterxml.jackson.core" % "jackson-databind" % Versions.jackson,
"com.fasterxml.jackson.core" % "jackson-core" % Versions.jackson,
"com.fasterxml.jackson.core" % "jackson-annotations" % Versions.jackson,
"com.fasterxml.jackson.dataformat" % "jackson-dataformat-cbor" % Versions.jackson,
"com.fasterxml.jackson.dataformat" % "jackson-dataformat-yaml" % Versions.jackson,
"com.fasterxml.jackson.datatype" % "jackson-datatype-jdk8" % Versions.jackson,
"com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % Versions.jackson,
"com.fasterxml.jackson.module" % "jackson-module-parameter-names" % Versions.jackson,
"com.fasterxml.jackson.module" %% "jackson-module-scala" % Versions.jackson,
)

val jacksonExclusions = Seq(
ExclusionRule(organization = "com.fasterxml.jackson.core"),
ExclusionRule(organization = "com.fasterxml.jackson.dataformat"),
ExclusionRule(organization = "com.fasterxml.jackson.datatype"),
ExclusionRule(organization = "com.fasterxml.jackson.module"),
ExclusionRule(organization = "org.codehaus.jackson")
)

Expand Down
Loading
Loading