Skip to content

Commit

Permalink
Add mima checking (#824)
Browse files Browse the repository at this point in the history
* Add mima checking

* add mima checks

* add mima checks

* add mima checks

* add mima checks
  • Loading branch information
IvanFinochenko committed Apr 23, 2024
1 parent 4d88246 commit 5319937
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ jobs:
run: sbt +Test/compile
- name: Check artifacts build process
run: sbt +publishLocal
- name: Mima check
run: sbt mimaChecks
- name: Check website build process
run: sbt docs/clean; sbt docs/buildWebsite
lint:
Expand Down
16 changes: 16 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import MimaSettings.mimaSettings
import zio.sbt.githubactions.Step.SingleStep

enablePlugins(ZioSbtEcosystemPlugin, ZioSbtCiPlugin)

inThisBuild(
Expand Down Expand Up @@ -28,6 +31,12 @@ inThisBuild(
)
),
ciEnabledBranches := Seq("series/2.x"),
ciCheckArtifactsBuildSteps ++= Seq(
SingleStep(
name = "Mima check",
run = Some("sbt mimaChecks")
)
),
pgpPassphrase := sys.env.get("PGP_PASSWORD").map(_.toArray),
pgpPublicRing := file("/tmp/public.asc"),
pgpSecretRing := file("/tmp/secret.asc"),
Expand All @@ -49,6 +58,10 @@ addCommandAlias(
"compileExamples",
"opentracingExample/compile;opentelemetryExample/compile;opentelemetryInstrumentationExample/compile"
)
addCommandAlias(
"mimaChecks",
"all opentracing/mimaReportBinaryIssues opentelemetry/mimaReportBinaryIssues opencensus/mimaReportBinaryIssues"
)

def stdModuleSettings(name: Option[String], packageName: Option[String]) =
stdSettings(name, packageName) ++
Expand Down Expand Up @@ -89,6 +102,7 @@ lazy val opentracing =
)
)
.settings(libraryDependencies ++= Dependencies.opentracing)
.settings(mimaSettings(failOnProblem = true))

lazy val opentelemetry =
project
Expand All @@ -101,6 +115,7 @@ lazy val opentelemetry =
)
)
.settings(libraryDependencies ++= Dependencies.opentelemetry)
.settings(mimaSettings(failOnProblem = true))

lazy val opencensus = project
.in(file("opencensus"))
Expand All @@ -112,6 +127,7 @@ lazy val opencensus = project
)
)
.settings(libraryDependencies ++= Dependencies.opencensus)
.settings(mimaSettings(failOnProblem = true))

lazy val opentracingExample =
project
Expand Down
20 changes: 20 additions & 0 deletions project/MimaSettings.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import com.typesafe.tools.mima.core.Problem
import com.typesafe.tools.mima.core.ProblemFilters.exclude
import com.typesafe.tools.mima.plugin.MimaKeys.*
import sbt.*
import sbt.Keys.{name, organization}

object MimaSettings {
lazy val bincompatVersionToCompare = "3.0.0-RC1"

def mimaSettings(failOnProblem: Boolean) =
Seq(
mimaPreviousArtifacts := Set(organization.value %% name.value % bincompatVersionToCompare),
mimaBinaryIssueFilters ++= Seq(
exclude[Problem]("zio.telemetry.opentelemetry.*"),
exclude[Problem]("zio.telemetry.opentracing.*"),
exclude[Problem]("zio.telemetry.opencensus.*")
),
mimaFailOnProblem := false
)
}
1 change: 1 addition & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.11
addSbtPlugin("dev.zio" % "zio-sbt-ci" % zioSbtVersion)
addSbtPlugin("dev.zio" % "zio-sbt-ecosystem" % zioSbtVersion)
addSbtPlugin("dev.zio" % "zio-sbt-website" % zioSbtVersion)
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.3")

libraryDependencies += "org.snakeyaml" % "snakeyaml-engine" % "2.7"

Expand Down

0 comments on commit 5319937

Please sign in to comment.