From c7372e270de6c468504a270e467ee187c43e46ae Mon Sep 17 00:00:00 2001 From: geirolz Date: Mon, 8 Jan 2024 15:41:41 +0100 Subject: [PATCH] Add mima as workflow step --- .github/workflows/cicd.yml | 8 ++++++-- .scalafmt.conf | 22 ++++++++++++---------- build.sbt | 34 ++++++++++++++-------------------- 3 files changed, 32 insertions(+), 32 deletions(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 6babef4..5e1bddd 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -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 @@ -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) diff --git a/.scalafmt.conf b/.scalafmt.conf index e66078a..11784e2 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -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 @@ -29,4 +25,10 @@ newlines.alwaysBeforeElseAfterCurlyIf = false rewrite.rules = [RedundantParens, SortImports] rewrite.redundantBraces.stringInterpolation = true -spaces.inImportCurlyBraces = false \ No newline at end of file +spaces.inImportCurlyBraces = false + +fileOverride { + "glob:**/scala-3*/**" { + runner.dialect = scala3 + } +} \ No newline at end of file diff --git a/build.sbt b/build.sbt index 5528c29..5f761bd 100644 --- a/build.sbt +++ b/build.sbt @@ -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", @@ -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 @@ -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, @@ -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 @@ -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;" -)