Skip to content

Commit

Permalink
Run tests via binary version
Browse files Browse the repository at this point in the history
Some modules are cross-compiled to only one Scala 3 version which needs
to be the oldest Scala 3 version, otherwise we can't make other modules
depend on it.
So we run tests by passing the binary version and let mill choose the
last available Scala version that matches
  • Loading branch information
lolgab committed Nov 15, 2023
1 parent 7d19a4c commit 7169155
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
fail-fast: false
matrix:
java-version: [8, 11]
scala-version: [2.12.18, 2.13.12, 3.2.2, 3.3.1]
scala-binary-version: [2.12, 2.13, 3]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -23,7 +23,7 @@ jobs:
- uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java-version }}
- run: ./mill -i unitTest "${{ matrix.scala-version }}"
- run: ./mill -i unitTest "${{ matrix.scala-binary-version }}"
itest:
strategy:
fail-fast: false
Expand All @@ -43,7 +43,7 @@ jobs:
strategy:
fail-fast: false
matrix:
scala-version: [2.12.18, 2.13.12, 3.2.2, 3.3.1]
scala-version: [2.12.18, 2.13.12, 3.2.2]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down
14 changes: 9 additions & 5 deletions build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -691,11 +691,15 @@ class SshdModule(val crossScalaVersion: String) extends AmmModule{
}
}

def unitTest(scalaVersion: String) = T.command{
terminal(scalaVersion).test.test()()
amm.repl(scalaVersion).test.test()()
amm(scalaVersion).test.test()()
sshd(scalaVersion).test.test()()
def unitTest(scalaBinaryVersion: String) = {
def cross[T <: AmmInternalModule](module: Cross[T]) =
module.items.find(_._1.head.asInstanceOf[String].startsWith(scalaBinaryVersion)).last._2
T.command{
cross(terminal).test.test()()
cross(amm.repl).test.test()()
cross(amm).test.test()()
cross(sshd).test.test()()
}
}

def integrationTest(scalaVersion: String) = T.command{
Expand Down

0 comments on commit 7169155

Please sign in to comment.