Skip to content

Commit

Permalink
Add mima as workflow step
Browse files Browse the repository at this point in the history
  • Loading branch information
geirolz committed Jan 8, 2024
1 parent 18ab433 commit c7372e2
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 32 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ jobs:
include:
- scala: 2.13.12
name: Scala2_13
test-tasks: coverage test coverageReport gen-doc mimaCheck
test-tasks: coverage test coverageReport gen-doc
- scala: 3.3.1
name: Scala3_3
test-tasks: coverage test coverageReport mimaCheck
test-tasks: coverage test coverageReport

steps:
- uses: actions/checkout@v4
Expand All @@ -60,6 +60,10 @@ jobs:
- name: Compile, Format, Test and Coverage for ${{ matrix.scala }}
run: sbt ++${{ matrix.scala }} clean scalafmtCheck ${{ matrix.test-tasks }}

#----------- MIMA -----------
- name: MiMa Report
run: sbt ++${{ matrix.scala }} mimaReportBinaryIssues

#----------- COVERAGE -----------
- name: Codecov
run: bash <(curl -s https://codecov.io/bash)
Expand Down
22 changes: 12 additions & 10 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
version = 3.7.17
encoding = "UTF-8"
runner.dialect = "scala213source3"
fileOverride {
"glob:**/core/src/main/scala-3/**" {
runner.dialect = scala3
}
"glob:**/core/src/test/scala-3/**" {
runner.dialect = scala3
}
}
maxColumn = 100

project.git = true
maxColumn = 100

align.openParenCallSite = false
align.openParenDefnSite = false
align.tokens = [
{code = "->"},
{code = "<-"},
{code = "="},
{code = ":="},
{code = "%"},
{code = "%%"},
{code = "=>", owner = "Case"},
]
continuationIndent.callSite = 2
Expand All @@ -29,4 +25,10 @@ newlines.alwaysBeforeElseAfterCurlyIf = false
rewrite.rules = [RedundantParens, SortImports]
rewrite.redundantBraces.stringInterpolation = true

spaces.inImportCurlyBraces = false
spaces.inImportCurlyBraces = false

fileOverride {
"glob:**/scala-3*/**" {
runner.dialect = scala3
}
}
34 changes: 14 additions & 20 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ lazy val root: Project = project
inThisBuild(
List(
organization := prjOrg,
homepage := Some(url(s"https://github.com/geirolz/$prjName")),
licenses := List("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")),
homepage := Some(url(s"https://github.com/geirolz/$prjName")),
licenses := List("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")),
developers := List(
Developer(
"DavidGeirola",
Expand Down Expand Up @@ -63,7 +63,7 @@ def module(modName: String)(
val publishSettings = publishAs match {
case Some(pubName) =>
Seq(
moduleName := pubName,
moduleName := pubName,
publish / skip := false
)
case None => noPublishSettings
Expand All @@ -77,9 +77,9 @@ def module(modName: String)(

Project(modName, file(folder))
.settings(
name := s"$prjName $modDocName",
mdocIn := file("docs"),
mdocOut := file("."),
name := s"$prjName $modDocName",
mdocIn := file("docs"),
mdocOut := file("."),
mdocScalacOptions := Seq("-Xsource:3"),
mdocVariables := Map(
"ORG" -> prjOrg,
Expand All @@ -99,20 +99,21 @@ def subProjectName(modPublishName: String): String = s"$prjName-$modPublishName"

//=============================== SETTINGS ===============================
lazy val noPublishSettings: Seq[Def.Setting[_]] = Seq(
publish := {},
publishLocal := {},
publishArtifact := false,
publish / skip := true
publish := {},
publishLocal := {},
publishArtifact := false,
publish / skip := true,
mimaFailOnNoPrevious := false
)

lazy val baseSettings: Seq[Def.Setting[_]] = Seq(
// project
name := prjName,
description := prjDescription,
name := prjName,
description := prjDescription,
organization := prjOrg,
// scala
crossScalaVersions := supportedScalaVersions,
scalaVersion := supportedScalaVersions.head,
scalaVersion := supportedScalaVersions.head,
scalacOptions ++= scalacSettings(scalaVersion.value),
versionScheme := Some("early-semver"),
// dependencies
Expand Down Expand Up @@ -197,10 +198,3 @@ addCommandAlias(
core
).map(prj => s"project ${prj.id}-docs; mdoc").mkString(";") + s";project root;"
)
addCommandAlias(
"mimaCheck",
List(
core
).map(prj => s"project ${prj.id}; mimaReportBinaryIssues")
.mkString(";") + s";project root;"
)

0 comments on commit c7372e2

Please sign in to comment.