Skip to content

Commit

Permalink
Make CI commands adequately scoped on Scala version
Browse files Browse the repository at this point in the history
  • Loading branch information
ruippeixotog committed Oct 15, 2021
1 parent 6e79180 commit fa8a149
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Expand Up @@ -28,12 +28,12 @@ jobs:
java-version: ${{ matrix.jdk }}

- name: Check formatting
run: sbt ++${{ matrix.scala-version }} scalafmtCheckAll scalafmtSbtCheck
run: sbt "++${{ matrix.scala-version }} scalafmtCheckAll" scalafmtSbtCheck

# Consider joining this action with the "Check formatting" one once Scalafix is supported for Scala 3.
- name: Run linter
if: startsWith(matrix.scala, '2')
run: sbt ++${{ matrix.scala-version }} "scalafixAll --check"
run: sbt "++${{ matrix.scala-version }} scalafixCheckAll"

- name: Compile
run: sbt "++${{ matrix.scala-version }} compile"
Expand Down Expand Up @@ -66,7 +66,7 @@ jobs:
- name: Check mdoc output
if: matrix.scala == '2.12'
run: >
sbt ++${{ matrix.scala-version }} mdoc &&
sbt "++${{ matrix.scala-version }} mdoc" &&
git diff --exit-code
build_website:
Expand Down
4 changes: 4 additions & 0 deletions build.sbt
Expand Up @@ -66,6 +66,9 @@ lazy val sttp = module(project) in file("modules/sttp")
lazy val yaml = module(project) in file("modules/yaml")
lazy val `zio-config` = module(project) in file("modules/zio-config")

// Workaround for https://github.com/scalacenter/scalafix/issues/1488
val scalafixCheckAll = taskKey[Unit]("No-arg alias for 'scalafixAll --check'")

lazy val commonSettings = Seq(
// format: off
homepage := Some(url("https://github.com/pureconfig/pureconfig")),
Expand Down Expand Up @@ -101,6 +104,7 @@ lazy val commonSettings = Seq(
case _ => List.empty
}.value,
scalafixOnCompile := forScalaVersions { case (2, _) => true; case _ => false }.value,
scalafixCheckAll := scalafixAll.toTask(" --check").value,

autoAPIMappings := true,

Expand Down

0 comments on commit fa8a149

Please sign in to comment.