Skip to content

Commit

Permalink
Add command for JVM/Native tests, use them in the CI
Browse files Browse the repository at this point in the history
  • Loading branch information
WojciechMazur committed Dec 20, 2024
1 parent 350a2be commit 9e9b8c9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ jobs:
distribution: temurin
java-version: ${{matrix.java}}
- uses: sbt/setup-sbt@v1
- name: Test
run: sbt "setScalaVersion ${{matrix.scala}}" test core/headerCheck package
- name: Test JVM
run: sbt "setScalaVersion ${{matrix.scala}}" testJVM core/headerCheck package
- name: Test Native
run: sbt "setScalaVersion ${{matrix.scala}}" testNative

test-rc:
strategy:
Expand All @@ -52,4 +54,4 @@ jobs:
java-version: ${{matrix.java}}
- uses: sbt/setup-sbt@v1
- name: Test
run: sbt "setScalaVersion ${{matrix.scala}}" test core/headerCheck package
run: sbt "setScalaVersion ${{matrix.scala}}" testJVM core/headerCheck package
11 changes: 11 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,14 @@ commands += Command.single("setScalaVersion") { (state, arg) =>
}
command :: state
}

def testPlatformCommand(name: String, selector: ProjectMatrix => sbt.internal.ProjectFinder): Command =
Command.command(name) { state =>
List(junit, scalacheck, testmacros)
.flatMap(selector(_).get)
.map{ project => s"${project.id}/test"}
.toList ::: state
}

commands += testPlatformCommand("testNative", _.native)
commands += testPlatformCommand("testJVM", _.jvm)

0 comments on commit 9e9b8c9

Please sign in to comment.