Skip to content

Commit

Permalink
Setup MiMa checks (#166)
Browse files Browse the repository at this point in the history
* Setup MiMa checks

* Address PR comments

* Address PR comments
  • Loading branch information
ptrdom authored Oct 28, 2024
1 parent 98ddadb commit bfc71f8
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 1 deletion.
47 changes: 47 additions & 0 deletions .github/workflows/binary-compatibility-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Binary Compatibility

on:
pull_request:
push:
branches:
- main

permissions: {}

jobs:
check-binary-compatibility:
name: Check / Binary Compatibility
runs-on: ubuntu-22.04
if: github.repository == 'apache/pekko-persistence-r2dbc'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: 0

- name: Setup Java 11
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 11

- name: Install sbt
uses: sbt/setup-sbt@v1

- name: Cache Coursier cache
uses: coursier/cache-action@v6

- name: Enable jvm-opts
run: cp .jvmopts-ci .jvmopts

- name: Compile code
run: sbt +compile

- name: Report MiMa Binary Issues
run: |-
sbt +mimaReportBinaryIssues
- name: Check correct MiMa filter directories
run: |
sbt checkMimaFilterDirectories
12 changes: 11 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ inThisBuild(
lazy val dontPublish = Seq(publish / skip := true, Compile / publishArtifact := false)

lazy val root = (project in file("."))
.disablePlugins(MimaPlugin)
.settings(dontPublish)
.settings(
name := "pekko-persistence-r2dbc-root")
Expand Down Expand Up @@ -70,12 +71,21 @@ lazy val migration = (project in file("migration"))
dependencyOverrides ++= Dependencies.pekkoTestDependencyOverrides,
Test / mainClass := Some("org.apache.pekko.persistence.r2dbc.migration.MigrationTool"),
Test / run / fork := true,
Test / run / javaOptions += "-Dlogback.configurationFile=logback-main.xml")
Test / run / javaOptions += "-Dlogback.configurationFile=logback-main.xml",
mimaPreviousArtifacts := {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((3, _)) =>
Set.empty
case _ =>
mimaPreviousArtifacts.value
}
})
.dependsOn(core % "compile->compile;test->test")

lazy val docs = project
.in(file("docs"))
.enablePlugins(PekkoParadoxPlugin, ParadoxSitePlugin, ScalaUnidocPlugin)
.disablePlugins(MimaPlugin)
.dependsOn(core, projection, migration)
.settings(dontPublish)
.settings(
Expand Down
1 change: 1 addition & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.10.0") // for maintenance o
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2")
addSbtPlugin("com.lightbend.sbt" % "sbt-java-formatter" % "0.8.0")
addSbtPlugin("com.github.sbt" % "sbt-unidoc" % "0.5.0")
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.4")

// for releasing
addSbtPlugin("com.github.sbt" % "sbt-dynver" % "5.1.0")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

# Caused by https://github.com/apache/pekko-persistence-r2dbc/pull/101
ProblemFilters.exclude[IncompatibleSignatureProblem]("org.apache.pekko.projection.r2dbc.javadsl.R2dbcSession.updateOne")
ProblemFilters.exclude[IncompatibleSignatureProblem]("org.apache.pekko.projection.r2dbc.javadsl.R2dbcSession.update")

0 comments on commit bfc71f8

Please sign in to comment.