Skip to content

Commit

Permalink
add Scala 3 support (#4)
Browse files Browse the repository at this point in the history
* add Scala 3 support
* add release workflow
* update plugins.sbt
* bump Scala versions
* bump version.sbt
* bump SBT

---------

Co-authored-by: msmiech <msmiech@evolution.com>
Co-authored-by: Mareks Rampāns <8796159+mr-git@users.noreply.github.com>
  • Loading branch information
3 people authored Jun 10, 2024
1 parent d210c60 commit 5051837
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 15 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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
10 changes: 7 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand All @@ -30,4 +32,6 @@ licenses := Seq(("MIT", url("https://opensource.org/licenses/MIT")))

releaseCrossBuild := true

ThisBuild / versionScheme := Some("semver-spec")
ThisBuild / versionScheme := Some("semver-spec")

addCommandAlias("check", "all scalafmtCheckAll scalafmtSbtCheck")
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.5.5
sbt.version=1.10.0
8 changes: 4 additions & 4 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -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")
addSbtPlugin("com.evolution" % "sbt-scalac-opts-plugin" % "0.0.9")
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion version.sbt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ThisBuild / version := "1.0.8-SNAPSHOT"
ThisBuild / version := "1.0.8"

0 comments on commit 5051837

Please sign in to comment.