Skip to content

Commit

Permalink
Merge pull request #27 from sjenna/upgrades
Browse files Browse the repository at this point in the history
Upgrade major versions, especially natchez, rediculous, and sbt plugins
  • Loading branch information
ChristopherDavenport authored Jun 21, 2023
2 parents 81c0ac7 + 061ea85 commit 7b28e42
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 75 deletions.
102 changes: 50 additions & 52 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ name: Continuous Integration

on:
pull_request:
branches: ['**']
branches: ['**', '!update/**', '!pr/**']
push:
branches: ['**']
branches: ['**', '!update/**', '!pr/**']
tags: [v*]

env:
Expand All @@ -28,34 +28,34 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.12.15, 2.13.7, 3.1.2]
scala: [2.12.18, 2.13.11, 3.3.0]
java: [temurin@8]
project: [rootJS, rootJVM]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Download Java (temurin@8)
id: download-java-temurin-8
if: matrix.java == 'temurin@8'
uses: typelevel/download-java@v1
uses: typelevel/download-java@v2
with:
distribution: temurin
java-version: 8

- name: Setup Java (temurin@8)
if: matrix.java == 'temurin@8'
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: jdkfile
java-version: 8
jdkFile: ${{ steps.download-java-temurin-8.outputs.jdkFile }}

- name: Cache sbt
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
~/.sbt
Expand All @@ -67,22 +67,22 @@ jobs:
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}

- name: Check that workflows are up to date
run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' 'project /' githubWorkflowCheck
run: sbt githubWorkflowCheck

- name: scalaJSLink
if: matrix.project == 'rootJS'
run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' Test/scalaJSLinkerResult
run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' Test/scalaJSLinkerResult

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

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

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

- name: Make target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
Expand All @@ -94,7 +94,7 @@ jobs:

- name: Upload target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-${{ matrix.scala }}-${{ matrix.project }}
path: targets.tar
Expand All @@ -106,33 +106,32 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.13.7]
java: [temurin@8]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Download Java (temurin@8)
id: download-java-temurin-8
if: matrix.java == 'temurin@8'
uses: typelevel/download-java@v1
uses: typelevel/download-java@v2
with:
distribution: temurin
java-version: 8

- name: Setup Java (temurin@8)
if: matrix.java == 'temurin@8'
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: jdkfile
java-version: 8
jdkFile: ${{ steps.download-java-temurin-8.outputs.jdkFile }}

- name: Cache sbt
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
~/.sbt
Expand All @@ -143,62 +142,62 @@ jobs:
~/Library/Caches/Coursier/v1
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}

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

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

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

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

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

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

- name: Inflate target directories (3.1.2, rootJVM)
- name: Inflate target directories (3.3.0, rootJVM)
run: |
tar xf targets.tar
rm targets.tar
Expand All @@ -215,40 +214,39 @@ jobs:
(echo "$PGP_PASSPHRASE"; echo; echo) | gpg --command-fd 0 --pinentry-mode loopback --change-passphrase $(gpg --list-secret-keys --with-colons 2> /dev/null | grep '^sec:' | cut --delimiter ':' --fields 5 | tail -n 1)
- name: Publish
run: sbt '++${{ matrix.scala }}' tlRelease
run: sbt tlCiRelease

site:
name: Generate Site
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.13.7]
java: [temurin@8]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Download Java (temurin@8)
id: download-java-temurin-8
if: matrix.java == 'temurin@8'
uses: typelevel/download-java@v1
uses: typelevel/download-java@v2
with:
distribution: temurin
java-version: 8

- name: Setup Java (temurin@8)
if: matrix.java == 'temurin@8'
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: jdkfile
java-version: 8
jdkFile: ${{ steps.download-java-temurin-8.outputs.jdkFile }}

- name: Cache sbt
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
~/.sbt
Expand All @@ -260,11 +258,11 @@ jobs:
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}

- name: Generate site
run: sbt '++${{ matrix.scala }}' site/tlSite
run: sbt site/tlSite

- name: Publish site
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v3.8.0
uses: peaceiris/actions-gh-pages@v3.9.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: site/target/docs/site
Expand Down
24 changes: 12 additions & 12 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ThisBuild / tlBaseVersion := "0.0" // your current series x.y
ThisBuild / tlBaseVersion := "0.1" // your current series x.y

ThisBuild / organization := "io.chrisdavenport"
ThisBuild / organizationName := "Christopher Davenport"
Expand All @@ -10,23 +10,23 @@ ThisBuild / tlCiReleaseBranches := Seq("main")
ThisBuild / tlSonatypeUseLegacyHost := true


val Scala213 = "2.13.7"
val Scala213 = "2.13.11"

ThisBuild / crossScalaVersions := Seq("2.12.15", Scala213, "3.1.2")
ThisBuild / crossScalaVersions := Seq("2.12.18", Scala213, "3.3.0")
ThisBuild / scalaVersion := Scala213

ThisBuild / testFrameworks += new TestFramework("munit.Framework")

val catsV = "2.7.0"
val catsEffectV = "3.3.11"
val fs2V = "3.2.7"
val http4sV = "0.23.11"
val circeV = "0.14.1"
val natchezV = "0.1.4"
val rediculousV = "0.3.0"
val catsV = "2.9.0"
val catsEffectV = "3.5.0"
val fs2V = "3.7.0"
val http4sV = "0.23.19"
val circeV = "0.14.5"
val natchezV = "0.3.2"
val rediculousV = "0.5.0"
val munitCatsEffectV = "1.0.7"

val slf4jV = "1.7.30"
val slf4jV = "1.7.36"


// Projects
Expand Down Expand Up @@ -63,7 +63,7 @@ lazy val examples = project.in(file("examples"))
scalacOptions -= "-Xfatal-warnings",
libraryDependencies ++= Seq(
"org.tpolecat" %% "natchez-jaeger" % natchezV,
"io.chrisdavenport" %% "natchez-http4s-otel" % "0.0.1",
"io.chrisdavenport" %% "natchez-http4s-otel" % "0.3.0-RC1",
"org.http4s" %% "http4s-dsl" % http4sV,
"org.http4s" %% "http4s-ember-server" % http4sV,
"org.slf4j" % "slf4j-simple" % slf4jV,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,17 @@ object OTDBTags {
// https://github.com/open-telemetry/opentelemetry-specification/blob/a50def370ef444029a12ea637769229768daeaf8/specification/trace/semantic_conventions/exceptions.md
object Errors {
def error(e: Throwable): List[(String, TraceValue)] = {
val error = ("error", TraceValue.boolToTraceValue(true)).some
val error = ("error", natchez.TraceableValue[Boolean].toTraceValue(true)).some
val message: Option[(String, TraceValue)] = Option(e.getMessage()).map(m => "exception.message" -> m)
val className: Option[(String, TraceValue)] = Option(e.getClass()).flatMap(c => Option(c.getName())).map(c => "exception.type" -> c)
val stacktrace = ("exception.stacktrace" -> TraceValue.stringToTraceValue(ErrorHelpers.printStackTrace(e))).some
val stacktrace = ("exception.stacktrace" -> natchez.TraceableValue[String].toTraceValue(ErrorHelpers.printStackTrace(e))).some
List(error, message, className, stacktrace).flatten // List[Option[A]] => List[A] using internal speedery
}

def outcome[F[_], A](outcome: Outcome[F, Throwable, A]): List[(String, TraceValue)] = outcome match {
case Canceled() =>
List("exit.case" -> "canceled")
case Errored(e) => "exit.case" -> TraceValue.stringToTraceValue("errored") :: error(e)
case Errored(e) => "exit.case" -> natchez.TraceableValue[String].toTraceValue("errored") :: error(e)
case Succeeded(_) => List("exit.case" -> "succeeded")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import io.chrisdavenport.natchezhttp4sotel._
import io.chrisdavenport.fiberlocal.GenFiberLocal
import com.comcast.ip4s._
import io.chrisdavenport.rediculous.RedisConnection
import fs2.io.net.Network

/**
* Start up Jaeger thus:
Expand All @@ -30,11 +31,11 @@ import io.chrisdavenport.rediculous.RedisConnection
object Http4sRediculousExample extends IOApp with Common {

// Our main app resource
def server[F[_]: Async: GenFiberLocal]: Resource[F, Server] =
def server[F[_]: Async: GenFiberLocal: Network]: Resource[F, Server] =
for {
ep <- entryPoint[F]
connectionF <- RedisConnectionMiddleware.pooled(RedisConnection.pool, RedisConnectionMiddleware.logFullStatement)
app = ServerMiddleware.httpApp(ep){implicit T: natchez.Trace[F] =>
app = ServerMiddleware.default(ep).buildHttpApp{implicit T: natchez.Trace[F] =>
val connection = connectionF(T)
routes(connection).orNotFound
}
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.6.2
sbt.version=1.9.0
10 changes: 5 additions & 5 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
addSbtPlugin("org.typelevel" % "sbt-typelevel-ci-release" % "0.4.9")
addSbtPlugin("org.typelevel" % "sbt-typelevel-site" % "0.4.9")
addSbtPlugin("org.typelevel" % "sbt-typelevel-settings" % "0.4.9")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.10.0")
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.2.0")
addSbtPlugin("org.typelevel" % "sbt-typelevel-ci-release" % "0.4.22")
addSbtPlugin("org.typelevel" % "sbt-typelevel-site" % "0.4.22")
addSbtPlugin("org.typelevel" % "sbt-typelevel-settings" % "0.4.22")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.13.1")
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.3.1")

0 comments on commit 7b28e42

Please sign in to comment.