Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Commit

Permalink
Merge pull request #41 from deal-engine/updates
Browse files Browse the repository at this point in the history
Updates
  • Loading branch information
fabianhjr-dealengine authored Nov 14, 2023
2 parents e940026 + 6efe83b commit d1a5a82
Show file tree
Hide file tree
Showing 5 changed files with 111 additions and 53 deletions.
106 changes: 79 additions & 27 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
matrix:
os: [ubuntu-latest]
scala: [2.13]
java: [temurin@8]
java: [temurin@11, temurin@17]
project: [rootJVM]
runs-on: ${{ matrix.os }}
timeout-minutes: 60
Expand All @@ -43,17 +43,30 @@ jobs:
with:
fetch-depth: 0

- name: Setup Java (temurin@8)
id: setup-java-temurin-8
if: matrix.java == 'temurin@8'
- name: Setup Java (temurin@11)
id: setup-java-temurin-11
if: matrix.java == 'temurin@11'
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 8
java-version: 11
cache: sbt

- name: sbt update
if: matrix.java == 'temurin@8' && steps.setup-java-temurin-8.outputs.cache-hit == 'false'
if: matrix.java == 'temurin@11' && steps.setup-java-temurin-11.outputs.cache-hit == 'false'
run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' reload +update

- name: Setup Java (temurin@17)
id: setup-java-temurin-17
if: matrix.java == 'temurin@17'
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
cache: sbt

- name: sbt update
if: matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false'
run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' reload +update

- name: Start up Postgres
Expand All @@ -66,18 +79,18 @@ jobs:
run: sbt githubWorkflowCheck

- name: Check formatting
if: matrix.java == 'temurin@8' && matrix.os == 'ubuntu-latest'
if: matrix.java == 'temurin@11' && matrix.os == 'ubuntu-latest'
run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' scalafmtCheckAll 'project /' scalafmtSbtCheck

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

- name: Check binary compatibility
if: matrix.java == 'temurin@8' && matrix.os == 'ubuntu-latest'
if: matrix.java == 'temurin@11' && matrix.os == 'ubuntu-latest'
run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' mimaReportBinaryIssues

- name: Generate API documentation
if: matrix.java == 'temurin@8' && matrix.os == 'ubuntu-latest'
if: matrix.java == 'temurin@11' && matrix.os == 'ubuntu-latest'
run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' doc

- name: Make target directories
Expand All @@ -102,25 +115,38 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
java: [temurin@8]
java: [temurin@11]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Java (temurin@8)
id: setup-java-temurin-8
if: matrix.java == 'temurin@8'
- name: Setup Java (temurin@11)
id: setup-java-temurin-11
if: matrix.java == 'temurin@11'
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 11
cache: sbt

- name: sbt update
if: matrix.java == 'temurin@11' && steps.setup-java-temurin-11.outputs.cache-hit == 'false'
run: sbt reload +update

- name: Setup Java (temurin@17)
id: setup-java-temurin-17
if: matrix.java == 'temurin@17'
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 8
java-version: 17
cache: sbt

- name: sbt update
if: matrix.java == 'temurin@8' && steps.setup-java-temurin-8.outputs.cache-hit == 'false'
if: matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false'
run: sbt reload +update

- name: Download target directories (2.13, rootJVM)
Expand Down Expand Up @@ -163,25 +189,38 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
java: [temurin@8]
java: [temurin@11]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Java (temurin@8)
id: setup-java-temurin-8
if: matrix.java == 'temurin@8'
- name: Setup Java (temurin@11)
id: setup-java-temurin-11
if: matrix.java == 'temurin@11'
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 8
java-version: 11
cache: sbt

- name: sbt update
if: matrix.java == 'temurin@8' && steps.setup-java-temurin-8.outputs.cache-hit == 'false'
if: matrix.java == 'temurin@11' && steps.setup-java-temurin-11.outputs.cache-hit == 'false'
run: sbt reload +update

- name: Setup Java (temurin@17)
id: setup-java-temurin-17
if: matrix.java == 'temurin@17'
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
cache: sbt

- name: sbt update
if: matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false'
run: sbt reload +update

- name: Submit Dependencies
Expand All @@ -195,25 +234,38 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
java: [temurin@8]
java: [temurin@11]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Java (temurin@8)
id: setup-java-temurin-8
if: matrix.java == 'temurin@8'
- name: Setup Java (temurin@11)
id: setup-java-temurin-11
if: matrix.java == 'temurin@11'
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 11
cache: sbt

- name: sbt update
if: matrix.java == 'temurin@11' && steps.setup-java-temurin-11.outputs.cache-hit == 'false'
run: sbt reload +update

- name: Setup Java (temurin@17)
id: setup-java-temurin-17
if: matrix.java == 'temurin@17'
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 8
java-version: 17
cache: sbt

- name: sbt update
if: matrix.java == 'temurin@8' && steps.setup-java-temurin-8.outputs.cache-hit == 'false'
if: matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false'
run: sbt reload +update

- name: Generate site
Expand Down
21 changes: 13 additions & 8 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// https://typelevel.org/sbt-typelevel/faq.html#what-is-a-base-version-anyway
ThisBuild / tlBaseVersion := "0.17" // your current series x.y
ThisBuild / tlBaseVersion := "0.18" // your current series x.y

ThisBuild / organization := "io.github.deal-engine"
ThisBuild / organizationName := "Deal Engine"
Expand All @@ -20,6 +20,11 @@ ThisBuild / tlSitePublishBranch := Some("master")

ThisBuild / tlFatalWarnings := false
ThisBuild / tlCiHeaderCheck := false

ThisBuild / githubWorkflowJavaVersions := Seq(
JavaSpec.temurin("11"),
JavaSpec.temurin("17")
)
ThisBuild / githubWorkflowBuildPreamble ++= Seq(
WorkflowStep.Run(
commands = List("docker-compose up -d"),
Expand All @@ -43,13 +48,13 @@ ThisBuild / scalaVersion := Scala213 // the default Scala

val Versions = {
class Versions {
val twitter = "22.12.0"
val circeTesting = "0.14.5"
val scalaTest = "3.2.16"
val scalaTestCheck = "3.2.16.0"
val twitter = "23.11.0"
val circeTesting = "0.14.6"
val scalaTest = "3.2.17"
val scalaTestCheck = "3.2.17.0"
val scalacheck = "1.17.0"
val scalamock = "5.2.0"
val quill = "4.6.1"
val quill = "4.8.0"
val weaver = "0.8.3"
}
new Versions
Expand Down Expand Up @@ -138,7 +143,7 @@ lazy val `weaver-twitter-future-core` = crossProject(JVMPlatform)
"com.twitter" %% "util-core" % Versions.twitter,
"com.disneystreaming" %% "weaver-core" % Versions.weaver,
"com.disneystreaming" %% "weaver-cats" % Versions.weaver,
"org.typelevel" %% "catbird-util" % Versions.twitter
"org.typelevel" %% "catbird-util" % "22.12.0" // TODO: Update
)
)

Expand All @@ -153,7 +158,7 @@ lazy val `weaver-twitter-future` = crossProject(JVMPlatform)
libraryDependencies ++= Seq(
"com.disneystreaming" %% "weaver-framework" % Versions.weaver,
"com.twitter" %% "util-core" % Versions.twitter,
"org.typelevel" %% "catbird-util" % Versions.twitter
"org.typelevel" %% "catbird-util" % "22.12.0" // TODO: Update
)
)
.dependsOn(`weaver-twitter-future-core`)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,13 @@ object Util {
// From cats
private val scheduler: Scheduler = new Scheduler {
override def sleep(delay: FiniteDuration, task: Runnable): Runnable =
() => Future.Unit.flatMap { _ =>
implicit val timer: JavaTimer = new JavaTimer()
Future.sleep(Duration.fromMilliseconds(delay.toMillis)).flatMap { _ =>
Future { task.run() }
() =>
Future.Unit.flatMap { _ =>
implicit val timer: JavaTimer = new JavaTimer()
Future.sleep(Duration.fromMilliseconds(delay.toMillis)).flatMap { _ =>
Future { task.run() }
}
}
}

override def nowMillis(): Long = System.currentTimeMillis()

Expand Down
24 changes: 12 additions & 12 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.9.3
sbt.version=1.9.7

0 comments on commit d1a5a82

Please sign in to comment.