Skip to content

Commit

Permalink
Add mima checking
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanFinochenko committed Apr 23, 2024
1 parent 4d88246 commit 3b82789
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,27 @@ jobs:
fetch-depth: '0'
- name: Test
run: sbt +test
mima:
name: Mima
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Install libuv
run: sudo apt-get update && sudo apt-get install -y libuv1-dev
- name: Setup Scala
uses: actions/[email protected]
with:
distribution: temurin
java-version: "8"
check-latest: true
- name: Cache Dependencies
uses: coursier/cache-action@v6
- name: Git Checkout
uses: actions/[email protected]
with:
fetch-depth: '0'
- name: Mima
run: sbt mimaChecks
update-readme:
name: Update README
runs-on: ubuntu-latest
Expand Down
9 changes: 9 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import MimaSettings.mimaSettings

enablePlugins(ZioSbtEcosystemPlugin, ZioSbtCiPlugin)

inThisBuild(
Expand Down Expand Up @@ -49,6 +51,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 +95,7 @@ lazy val opentracing =
)
)
.settings(libraryDependencies ++= Dependencies.opentracing)
.settings(mimaSettings(failOnProblem = true))

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

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

lazy val opentracingExample =
project
Expand Down
18 changes: 18 additions & 0 deletions project/MimaSettings.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
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.*")
),
mimaFailOnProblem := failOnProblem
)
}
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 3b82789

Please sign in to comment.