Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mima checking #824

Merged
merged 5 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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