diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cdd27de..aa9adbd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,8 +10,9 @@ jobs: strategy: matrix: scala: - - 2.13.7 - - 2.12.15 + - 2.13.14 + - 2.12.19 + - 3.3.3 steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..2cba89f --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,11 @@ +name: Publish Release + +on: + release: + types: [published] + branches: [master] + +jobs: + release: + uses: evolution-gaming/scala-github-actions/.github/workflows/release.yml@v1 + secrets: inherit diff --git a/build.sbt b/build.sbt index 6fa3155..7425707 100644 --- a/build.sbt +++ b/build.sbt @@ -10,16 +10,18 @@ organizationName := "Evolution" organizationHomepage := Some(url("http://evolution.com")) -crossScalaVersions := Seq("2.13.7", "2.12.15") +crossScalaVersions := Seq("2.13.14", "2.12.19", "3.3.3") scalaVersion := crossScalaVersions.value.head +Compile / scalacOptions ++= Seq("-language:implicitConversions") + Compile / doc / scalacOptions ++= Seq("-groups", "-implicits", "-no-link-warnings") publishTo := Some(Resolver.evolutionReleases) libraryDependencies ++= Seq( - "com.evolutiongaming" %% "executor-tools" % "1.0.3", + "com.evolutiongaming" %% "executor-tools" % "1.0.4", "io.prometheus" % "simpleclient_common" % "0.8.1", "org.scalameta" %% "munit" % "0.7.29" % Test ) @@ -30,4 +32,6 @@ licenses := Seq(("MIT", url("https://opensource.org/licenses/MIT"))) releaseCrossBuild := true -ThisBuild / versionScheme := Some("semver-spec") \ No newline at end of file +ThisBuild / versionScheme := Some("semver-spec") + +addCommandAlias("check", "all scalafmtCheckAll scalafmtSbtCheck") diff --git a/project/build.properties b/project/build.properties index 10fd9ee..081fdbb 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.5.5 +sbt.version=1.10.0 diff --git a/project/plugins.sbt b/project/plugins.sbt index 2b2ee2c..e08462f 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,11 +1,11 @@ addSbtPlugin("com.evolution" % "sbt-artifactory-plugin" % "0.0.2") -addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.9.2") +addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.12") -addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.3.1") +addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.3.11") -addSbtPlugin("com.github.sbt" % "sbt-release" % "1.1.0") +addSbtPlugin("com.github.sbt" % "sbt-release" % "1.4.0") addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.3") -addSbtPlugin("com.evolution" % "sbt-scalac-opts-plugin" % "0.0.9") \ No newline at end of file +addSbtPlugin("com.evolution" % "sbt-scalac-opts-plugin" % "0.0.9") diff --git a/src/main/scala/com/evolutiongaming/prometheus/PrometheusHelper.scala b/src/main/scala/com/evolutiongaming/prometheus/PrometheusHelper.scala index aadee95..1abbda7 100644 --- a/src/main/scala/com/evolutiongaming/prometheus/PrometheusHelper.scala +++ b/src/main/scala/com/evolutiongaming/prometheus/PrometheusHelper.scala @@ -3,11 +3,11 @@ package com.evolutiongaming.prometheus import com.evolutiongaming.concurrent.CurrentThreadExecutionContext import io.prometheus.client.{Gauge, Histogram, SimpleCollector, Summary} -import scala.concurrent.Future +import scala.concurrent.{ExecutionContext, Future} object PrometheusHelper { - private implicit val ec = CurrentThreadExecutionContext - private implicit val clock = ClockPlatform.default + private implicit val ec: ExecutionContext = CurrentThreadExecutionContext + private implicit val clock: ClockPlatform = ClockPlatform.default implicit val histogramObs: HasObserve[Histogram] = (histogram: Histogram, duration: Double) => histogram.observe(duration) diff --git a/src/test/scala/com/evolutiongaming/prometheus/ObserveDurationSpec.scala b/src/test/scala/com/evolutiongaming/prometheus/ObserveDurationSpec.scala index 4bd68bb..e4a32f9 100644 --- a/src/test/scala/com/evolutiongaming/prometheus/ObserveDurationSpec.scala +++ b/src/test/scala/com/evolutiongaming/prometheus/ObserveDurationSpec.scala @@ -3,9 +3,11 @@ package com.evolutiongaming.prometheus import com.evolutiongaming.concurrent.CurrentThreadExecutionContext import io.prometheus.client.Collector +import scala.concurrent.ExecutionContext + class ObserveDurationSpec extends munit.FunSuite with munit.Assertions { - private implicit val ec = CurrentThreadExecutionContext + private implicit val ec: ExecutionContext = CurrentThreadExecutionContext def cmp(x: Double, y: Double): Boolean = Math.abs(x - y) <= 0.000000001 diff --git a/version.sbt b/version.sbt index 572651e..4720904 100644 --- a/version.sbt +++ b/version.sbt @@ -1 +1 @@ -ThisBuild / version := "1.0.8-SNAPSHOT" +ThisBuild / version := "1.0.8"