diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c305d4d3..34c8397c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: diff --git a/build.sbt b/build.sbt index 32014b0f..2cf61d82 100644 --- a/build.sbt +++ b/build.sbt @@ -1,3 +1,6 @@ +import MimaSettings.mimaSettings +import zio.sbt.githubactions.Step.SingleStep + enablePlugins(ZioSbtEcosystemPlugin, ZioSbtCiPlugin) inThisBuild( @@ -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"), @@ -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) ++ @@ -89,6 +102,7 @@ lazy val opentracing = ) ) .settings(libraryDependencies ++= Dependencies.opentracing) + .settings(mimaSettings(failOnProblem = true)) lazy val opentelemetry = project @@ -101,6 +115,7 @@ lazy val opentelemetry = ) ) .settings(libraryDependencies ++= Dependencies.opentelemetry) + .settings(mimaSettings(failOnProblem = true)) lazy val opencensus = project .in(file("opencensus")) @@ -112,6 +127,7 @@ lazy val opencensus = project ) ) .settings(libraryDependencies ++= Dependencies.opencensus) + .settings(mimaSettings(failOnProblem = true)) lazy val opentracingExample = project diff --git a/project/MimaSettings.scala b/project/MimaSettings.scala new file mode 100644 index 00000000..7d784814 --- /dev/null +++ b/project/MimaSettings.scala @@ -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 + ) +} diff --git a/project/plugins.sbt b/project/plugins.sbt index c5e12e2a..a080c819 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -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"