From 06df66a2dfc8cdd77b435790624eeee565edfd5f Mon Sep 17 00:00:00 2001 From: Jakob Odersky Date: Mon, 23 Sep 2019 01:44:06 -0400 Subject: build matrix --- .github/workflows/main.yml | 7 +++++-- build.sc | 10 ++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d698cd0..6ae537a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,6 +11,9 @@ on: jobs: build: + strategy: + matrix: + scala: ["2.13.1", "2.12.10", "2.11.12"] runs-on: ubuntu-latest steps: @@ -19,12 +22,12 @@ jobs: - uses: jodersky/setup-mill@master - name: Test - run: mill commando.test + run: mill -D scala.version=${{matrix.scala}} commando.test - name: Publish Tag if: startsWith(github.ref, 'refs/tags/') run: | echo "${{secrets.GPG_KEY}}" | gpg --import - mill mill.scalalib.PublishModule/publishAll \ + mill -D scala.version=${{matrix.scala}} mill.scalalib.PublishModule/publishAll \ --sonatypeCreds "8VNUX6+2:${{secrets.SONATYPE_PASSWORD}}" \ --publishArtifacts __.publishArtifacts diff --git a/build.sc b/build.sc index f9ed49c..5ad0774 100644 --- a/build.sc +++ b/build.sc @@ -1,11 +1,13 @@ import mill._, scalalib._, scalafmt._, scalalib.publish._ object commando extends ScalaModule with ScalafmtModule with PublishModule { - //def scalaVersion = T.input { - //scala.sys.props.toMap.getOrElse("scala.version", "2.13.1").call() - //} - def scalaVersion = "2.13.1" + def scalaVersion = T.input { + sys.props.toMap.get("scala.version") match { + case Some(v) => v + case None => "2.13.1" + } + } object test extends Tests { def ivyDeps = Agg( -- cgit v1.2.3