Skip to content

Commit

Permalink
Merge pull request #58 from fmonniot/test-newer-scala-versions
Browse files Browse the repository at this point in the history
Change how we do testing for 3.3+
  • Loading branch information
fmonniot committed Jun 26, 2024
2 parents 83ca10e + 6519b9c commit ebbf7ab
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 7 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,25 @@ jobs:
distribution: 'temurin'
java-version: '11'
- run: sbt test
# We currently depends on a bug fix in 3.4, which at the time this
# check was written was not yet released. So instead we rely on a
# nightly version.
test-newer:
name: Test (${{ matrix.scalaV }})
# We still want to be able to test out the library on newer Scala version.
# For those version, we compile the library using 3.2 and then run the tests
# against the newer version. This effectively emulate what our users are doing.
test-integration:
name: Integration Test (${{ matrix.scalaV }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
scalaV:
- "3.4.0-RC1-bin-20230909-64c3138-NIGHTLY"
- "3.3.3"
- "3.4.2"
- "3.5.0-RC1"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
- run: sbt '++${{ matrix.scalaV }}! test'
- run: |
sbt 'core/publishLocal'
sbt '++${{ matrix.scalaV }}! integration/test'
21 changes: 21 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,24 @@ lazy val docs = project
),
libraryDependencies += "org.typelevel" %% "cats-effect" % "3.5.4"
)

/* This project is a bit particular in how it operates. Because compiling the library itself
is restricted to 3.2.x at the moment, we cannot use the regular cross compilation scheme for
testing. Instead, what we do is that we compile the library using 3.2.2, and then depend on
that compiled jar in the integration tests using more recent version of the compiler.
This project is only used to provide this integration point (the src directory only contain
a symlink to the core tests). See the GitHub Actions to see how to use it.
*/
lazy val integration = project
.in(file("./integration"))
.settings(
name := "scala3mock-integration-tests",

crossScalaVersions := Seq("3.3.3", "3.4.0", "3.5.0-RC1"),

// Note that this means we need to publish core via publishLocal first.
libraryDependencies += "eu.monniot" %% "scala3mock" % version.value % Test,
libraryDependencies += "org.scalameta" %% "munit" % "1.0.0-M11" % Test,
)
1 change: 1 addition & 0 deletions integration/src/test

0 comments on commit ebbf7ab

Please sign in to comment.