Skip to content

Commit

Permalink
Add MiMa binary compatibility checks
Browse files Browse the repository at this point in the history
  • Loading branch information
plokhotnyuk committed Jan 13, 2025
1 parent e604945 commit cd280dc
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ jobs:
run: sbt ++${{ matrix.scala }}! testScala2${{ matrix.platform }}
- name: Run tests
run: sbt ++${{ matrix.scala }}! test${{ matrix.platform }}
- name: Run MiMa checks
run: sbt ++${{ matrix.scala }}! mimaReportBinaryIssues

ci:
runs-on: ubuntu-20.04
Expand Down
2 changes: 2 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ lazy val zioJsonRoot = project
.in(file("."))
.settings(
publish / skip := true,
mimaPreviousArtifacts := Set(),
unusedCompileDependenciesFilter -= moduleFilter("org.scala-js", "scalajs-library")
)
.aggregate(
Expand Down Expand Up @@ -400,6 +401,7 @@ lazy val docs = project
zioJsonInteropScalaz7x.jvm,
zioJsonGolden
),
mimaPreviousArtifacts := Set(),
readmeAcknowledgement :=
"""|- Uses [JsonTestSuite](https://github.com/nst/JSONTestSuite) to test parsing. (c) 2016 Nicolas Seriot)
|
Expand Down
2 changes: 1 addition & 1 deletion project/BuildHelper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ object BuildHelper {
incOptions ~= (_.withLogRecompileOnMacro(false)),
autoAPIMappings := true,
unusedCompileDependenciesFilter -= moduleFilter("org.scala-js", "scalajs-library")
)
) ++ MimaSettings.mimaSettings(true)

def macroExpansionSettings = Seq(
scalacOptions ++= {
Expand Down
22 changes: 22 additions & 0 deletions project/MimaSettings.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import com.typesafe.tools.mima.core.*
import com.typesafe.tools.mima.core.ProblemFilters.*
import com.typesafe.tools.mima.plugin.MimaKeys.*
import sbt.{Def, *}
import sbt.Keys.{name, organization}
import sbtdynver.DynVerPlugin.autoImport.*

object MimaSettings {
def mimaSettings(failOnProblem: Boolean): Seq[Def.Setting[?]] =
Seq(
mimaPreviousArtifacts ++= previousStableVersion.value.map(organization.value %% name.value % _).toSet,
mimaBinaryIssueFilters ++= Seq(
exclude[Problem]("zio.JsonPackagePlatformSpecific.*"),
exclude[Problem]("zio.json.JsonDecoderPlatformSpecific.*"),
exclude[Problem]("zio.json.JsonEncoderPlatformSpecific.*"),
exclude[Problem]("zio.json.internal.*"),
exclude[Problem]("zio.json.package.*"),
exclude[Problem]("zio.json.yaml.internal.*"),
),
mimaFailOnProblem := failOnProblem
)
}

0 comments on commit cd280dc

Please sign in to comment.