Skip to content

Commit b6e7ead

Browse files
committed
Extract mima as a separate build step
1 parent 0130170 commit b6e7ead

File tree

2 files changed

+35
-5
lines changed

2 files changed

+35
-5
lines changed

.github/workflows/ci.yml

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ jobs:
3131
run: sudo apt-get install libidn11-dev
3232
- name: Compile
3333
run: sbt -v compile
34-
- name: Check MiMa # disable for major releases
35-
run: sbt -v mimaReportBinaryIssues
3634
- name: Test
3735
run: sbt -v test
3836
- name: Cleanup
@@ -43,6 +41,37 @@ jobs:
4341
find $HOME/.cache/coursier/v1 -name "ivydata-*.properties" -delete || true
4442
find $HOME/.sbt -name "*.lock" -delete || true
4543
44+
mima:
45+
# run on external PRs, but not on internal PRs since those will be run by push to branch
46+
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
47+
runs-on: ubuntu-20.04
48+
steps:
49+
- name: Checkout
50+
uses: actions/checkout@v2
51+
with:
52+
fetch-depth: 0 # checkout tags so that dynver works properly (we need the version for MiMa)
53+
- name: Set up JDK 11
54+
uses: actions/setup-java@v1
55+
with:
56+
java-version: 11
57+
- name: Cache sbt
58+
uses: actions/cache@v2
59+
with:
60+
path: |
61+
~/.sbt
62+
~/.ivy2/cache
63+
~/.coursier
64+
key: sbt-cache-${{ runner.os }}-JVM-${{ hashFiles('project/build.properties') }}
65+
- name: Check MiMa # disable for major releases
66+
run: sbt -v mimaReportBinaryIssues
67+
- name: Cleanup
68+
run: |
69+
rm -rf "$HOME/.ivy2/local" || true
70+
find $HOME/.ivy2/cache -name "ivydata-*.properties" -delete || true
71+
find $HOME/.ivy2/cache -name "*-LM-SNAPSHOT*" -delete || true
72+
find $HOME/.cache/coursier/v1 -name "ivydata-*.properties" -delete || true
73+
find $HOME/.sbt -name "*.lock" -delete || true
74+
4675
publish:
4776
name: Publish release
4877
needs: [ci]

build.sbt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,15 @@ val commonSettings = commonSmlBuildSettings ++ ossPublishSettings ++ Seq(
2929
libraryDependencies ++= Seq(
3030
"org.scalatest" %% "scalatest" % scalaTestVersion % Test
3131
),
32-
mimaPreviousArtifacts := previousStableVersion.value.map(organization.value %% moduleName.value % _).toSet,
33-
mimaReportBinaryIssues := { if ((publish / skip).value) {} else mimaReportBinaryIssues.value },
32+
mimaPreviousArtifacts := Set.empty,
3433
versionScheme := Some("semver-spec")
3534
)
3635

3736
val commonJvmSettings = commonSettings ++ Seq(
3837
scalacOptions ++= Seq("-target:jvm-1.8"),
39-
ideSkipProject := (scalaVersion.value != scala2_13)
38+
ideSkipProject := (scalaVersion.value != scala2_13),
39+
mimaPreviousArtifacts := previousStableVersion.value.map(organization.value %% moduleName.value % _).toSet,
40+
mimaReportBinaryIssues := { if ((publish / skip).value) {} else mimaReportBinaryIssues.value }
4041
)
4142

4243
val commonJsSettings = commonSettings ++ Seq(

0 commit comments

Comments
 (0)