Skip to content

Commit 5071255

Browse files
committed
Simplify specifying Scala version for tests
1 parent 6991da7 commit 5071255

File tree

3 files changed

+8
-16
lines changed

3 files changed

+8
-16
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
name: CI
2-
31
on:
42
pull_request:
53
push:
@@ -31,13 +29,7 @@ jobs:
3129
- uses: actions/checkout@v2
3230
- uses: olafurpg/setup-scala@v13
3331
- uses: coursier/cache-action@v6
34-
- run: |
35-
case ${{ matrix.scala }} in
36-
2.11) sbt "functional-tests/runMain com.typesafe.tools.mima.lib.UnitTests -211" ;;
37-
2.12) sbt "functional-tests/runMain com.typesafe.tools.mima.lib.UnitTests -212" ;;
38-
2.13) sbt "functional-tests/runMain com.typesafe.tools.mima.lib.UnitTests -213" ;;
39-
3) sbt "functional-tests/runMain com.typesafe.tools.mima.lib.UnitTests -3" ;;
40-
esac
32+
- run: sbt "functional-tests/runMain com.typesafe.tools.mima.lib.UnitTests -${{ matrix.scala }}"
4133
testScripted:
4234
needs: build
4335
strategy:

.travis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jdk:
1414

1515
jobs:
1616
include:
17-
- { name: testFunctional 2.11, script: sbt "functional-tests/runMain com.typesafe.tools.mima.lib.UnitTests -211" }
18-
- { name: testFunctional 2.12, script: sbt "functional-tests/runMain com.typesafe.tools.mima.lib.UnitTests -212" }
19-
- { name: testFunctional 2.13, script: sbt "functional-tests/runMain com.typesafe.tools.mima.lib.UnitTests -213" }
20-
- { name: testFunctional 3, script: sbt "functional-tests/runMain com.typesafe.tools.mima.lib.UnitTests -3" }
17+
- { name: testFunctional 2.11, script: sbt "functional-tests/runMain com.typesafe.tools.mima.lib.UnitTests -2.11" }
18+
- { name: testFunctional 2.12, script: sbt "functional-tests/runMain com.typesafe.tools.mima.lib.UnitTests -2.12" }
19+
- { name: testFunctional 2.13, script: sbt "functional-tests/runMain com.typesafe.tools.mima.lib.UnitTests -2.13" }
20+
- { name: testFunctional 3, script: sbt "functional-tests/runMain com.typesafe.tools.mima.lib.UnitTests -3" }
2121
- { name: scripted 1/2, script: sbt "scripted sbt-mima-plugin/*1of2" }
2222
- { name: scripted 2/2, script: sbt "scripted sbt-mima-plugin/*2of2" }
2323

functional-tests/src/main/scala/com/typesafe/tools/mima/lib/TestCli.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ object TestCli {
5252

5353
@tailrec private def readArgs(args: List[String], conf: Conf): Conf = args match {
5454
case "-3" :: xs => readArgs(xs, conf.copy(scalaVersions = scala3 :: conf.scalaVersions))
55-
case "-213" :: xs => readArgs(xs, conf.copy(scalaVersions = scala213 :: conf.scalaVersions))
56-
case "-212" :: xs => readArgs(xs, conf.copy(scalaVersions = scala212 :: conf.scalaVersions))
57-
case "-211" :: xs => readArgs(xs, conf.copy(scalaVersions = scala211 :: conf.scalaVersions))
55+
case "-2.13" :: xs => readArgs(xs, conf.copy(scalaVersions = scala213 :: conf.scalaVersions))
56+
case "-2.12" :: xs => readArgs(xs, conf.copy(scalaVersions = scala212 :: conf.scalaVersions))
57+
case "-2.11" :: xs => readArgs(xs, conf.copy(scalaVersions = scala211 :: conf.scalaVersions))
5858
case "--scala-version" :: sv :: xs => readArgs(xs, conf.copy(scalaVersions = sv :: conf.scalaVersions))
5959
case "--cross" :: xs => readArgs(xs, conf.copy(scalaVersions = allScalaVersions))
6060
case s :: xs => readArgs(xs, conf.copy(dirs = testDirs(s) ::: conf.dirs))

0 commit comments

Comments
 (0)