From 0e04e1dd9c11253cf4010c306c818abb330bdfab Mon Sep 17 00:00:00 2001 From: Vasil Vasilev Date: Fri, 21 May 2021 14:32:01 +0200 Subject: [PATCH 01/20] Remove unnecessary sbt-scalafix plugin from the main fs2 project --- project/plugins.sbt | 1 - 1 file changed, 1 deletion(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index 23a5bbd079..ae0bfa6795 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -6,4 +6,3 @@ addSbtPlugin("com.typesafe.sbt" % "sbt-osgi" % "0.9.6") addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.3") addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.2") addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.2.21") -addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.29") From c5fd3fbeb09dd0b1ee03efb60a6036cf0e6410bc Mon Sep 17 00:00:00 2001 From: Vasil Vasilev Date: Fri, 21 May 2021 14:33:48 +0200 Subject: [PATCH 02/20] Update sbt to 1.5.2 in scalafix subproject --- scalafix/project/build.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scalafix/project/build.properties b/scalafix/project/build.properties index 7c58a83abf..19479ba46f 100644 --- a/scalafix/project/build.properties +++ b/scalafix/project/build.properties @@ -1 +1 @@ -sbt.version=1.2.6 +sbt.version=1.5.2 From 1797fe912f8a777f37821065dde215b35f47484a Mon Sep 17 00:00:00 2001 From: Vasil Vasilev Date: Fri, 21 May 2021 14:56:32 +0200 Subject: [PATCH 03/20] Fix old sbt syntax in scalafix project --- scalafix/build.sbt | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/scalafix/build.sbt b/scalafix/build.sbt index 4817d90095..fe2fcc02de 100644 --- a/scalafix/build.sbt +++ b/scalafix/build.sbt @@ -20,7 +20,7 @@ inThisBuild( ) ) -skip in publish := true +publish / skip := true lazy val rules = project.settings( moduleName := "scalafix", @@ -28,7 +28,7 @@ lazy val rules = project.settings( ) lazy val input = project.settings( - skip in publish := true, + publish / skip := true, libraryDependencies ++= Seq( "co.fs2" %% "fs2-core" % "0.10.6", "com.typesafe.akka" %% "akka-stream" % "2.5.21" @@ -36,7 +36,7 @@ lazy val input = project.settings( ) lazy val output = project.settings( - skip in publish := true, + publish / skip := true, libraryDependencies ++= Seq( "co.fs2" %% "fs2-core" % "1.0.0" ) @@ -44,16 +44,17 @@ lazy val output = project.settings( lazy val tests = project .settings( - skip in publish := true, - libraryDependencies += "ch.epfl.scala" % "scalafix-testkit" % V.scalafixVersion % Test cross CrossVersion.full, - compile.in(Compile) := - compile.in(Compile).dependsOn(compile.in(input, Compile)).value, + publish / skip := true, + libraryDependencies += ("ch.epfl.scala" % "scalafix-testkit" % V.scalafixVersion % Test) + .cross(CrossVersion.full), + Compile / compile := + (Compile / compile).dependsOn(input / Compile / compile).value, scalafixTestkitOutputSourceDirectories := - sourceDirectories.in(output, Compile).value, + (output / Compile / sourceDirectories).value, scalafixTestkitInputSourceDirectories := - sourceDirectories.in(input, Compile).value, + (input / Compile / sourceDirectories).value, scalafixTestkitInputClasspath := - fullClasspath.in(input, Compile).value, + (input / Compile / fullClasspath).value ) .dependsOn(rules) .enablePlugins(ScalafixTestkitPlugin) From 2e6546818c9c15c070c8639dfdffbb5c9e6dedba Mon Sep 17 00:00:00 2001 From: Vasil Vasilev Date: Fri, 21 May 2021 16:23:36 +0200 Subject: [PATCH 04/20] Update sbt-scalafix to 0.9.28 --- scalafix/project/plugins.sbt | 3 +-- scalafix/rules/src/main/scala/fix/v1.scala | 2 +- scalafix/tests/src/test/scala/fix/RuleSuite.scala | 5 +++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scalafix/project/plugins.sbt b/scalafix/project/plugins.sbt index b627e30b01..665bb90626 100644 --- a/scalafix/project/plugins.sbt +++ b/scalafix/project/plugins.sbt @@ -1,2 +1 @@ -resolvers += Resolver.sonatypeRepo("releases") -addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.1") +addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.28") diff --git a/scalafix/rules/src/main/scala/fix/v1.scala b/scalafix/rules/src/main/scala/fix/v1.scala index 5703880f86..8f2667ba0a 100644 --- a/scalafix/rules/src/main/scala/fix/v1.scala +++ b/scalafix/rules/src/main/scala/fix/v1.scala @@ -391,7 +391,7 @@ object StreamAppRules { tpl.copy( inits = tpl.inits :+ Init(Type.Name("IOApp"), Name("IOApp"), List()), stats = addProgramRun(tpl.stats)).toString() - ) + ) + Patch.addLeft(tpl, "extends ") private[this] def replaceStats(stats: List[Stat]): List[Patch] = stats.flatMap{ diff --git a/scalafix/tests/src/test/scala/fix/RuleSuite.scala b/scalafix/tests/src/test/scala/fix/RuleSuite.scala index edf7aeda0b..22fb678dac 100644 --- a/scalafix/tests/src/test/scala/fix/RuleSuite.scala +++ b/scalafix/tests/src/test/scala/fix/RuleSuite.scala @@ -1,7 +1,8 @@ package fix -import scalafix.testkit.SemanticRuleSuite +import org.scalatest.FunSuiteLike +import scalafix.testkit.AbstractSemanticRuleSuite -class RuleSuite extends SemanticRuleSuite() { +class RuleSuite extends AbstractSemanticRuleSuite with FunSuiteLike { runAllTests() } From 289dc9709f258877fc311dd708f73b2dda34523e Mon Sep 17 00:00:00 2001 From: Vasil Vasilev Date: Fri, 21 May 2021 16:24:53 +0200 Subject: [PATCH 05/20] Fix compilation error in Usability test --- scalafix/input/src/main/scala/fix/Usability.scala | 3 ++- scalafix/output/src/main/scala/fix/Usability.scala | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/scalafix/input/src/main/scala/fix/Usability.scala b/scalafix/input/src/main/scala/fix/Usability.scala index d3cb2e1d76..1eb75095f5 100644 --- a/scalafix/input/src/main/scala/fix/Usability.scala +++ b/scalafix/input/src/main/scala/fix/Usability.scala @@ -3,11 +3,12 @@ rule = v1 */ package fix -import cats.effect.IO +import cats.effect.{Concurrent, IO} import fs2._ import scala.concurrent.ExecutionContext.Implicits.global trait Usability { + implicit def C: Concurrent[IO] def s: Stream[IO, String] val observe1 = s.observe1(_ => IO.unit) diff --git a/scalafix/output/src/main/scala/fix/Usability.scala b/scalafix/output/src/main/scala/fix/Usability.scala index 76c26e01c2..1acf507d9d 100644 --- a/scalafix/output/src/main/scala/fix/Usability.scala +++ b/scalafix/output/src/main/scala/fix/Usability.scala @@ -1,10 +1,11 @@ package fix -import cats.effect.IO +import cats.effect.{Concurrent, IO} import fs2._ import scala.concurrent.ExecutionContext.Implicits.global trait Usability { + implicit def C: Concurrent[IO] def s: Stream[IO, String] val observe1 = s.evalTap(_ => IO.unit) From 04d6f14c81414f8e36c1898a1978bc1bbea76d73 Mon Sep 17 00:00:00 2001 From: Vasil Vasilev Date: Fri, 21 May 2021 16:25:48 +0200 Subject: [PATCH 06/20] Fix compilation error in Scheduler test --- scalafix/input/src/main/scala/fix/Scheduler.scala | 2 +- scalafix/output/src/main/scala/fix/Scheduler.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scalafix/input/src/main/scala/fix/Scheduler.scala b/scalafix/input/src/main/scala/fix/Scheduler.scala index c5e3464917..44b536350b 100644 --- a/scalafix/input/src/main/scala/fix/Scheduler.scala +++ b/scalafix/input/src/main/scala/fix/Scheduler.scala @@ -9,7 +9,7 @@ import fs2._ import scala.concurrent.ExecutionContext.Implicits.global import scala.concurrent.duration._ -abstract class SchedulerTimer[F[_]: Effect] { +abstract class SchedulerTimer[F[_]: ConcurrentEffect: Timer] { val scheduler: Scheduler val duration = 1.second diff --git a/scalafix/output/src/main/scala/fix/Scheduler.scala b/scalafix/output/src/main/scala/fix/Scheduler.scala index 8577c55980..ec38bd08bc 100644 --- a/scalafix/output/src/main/scala/fix/Scheduler.scala +++ b/scalafix/output/src/main/scala/fix/Scheduler.scala @@ -6,7 +6,7 @@ import fs2._ import scala.concurrent.ExecutionContext.Implicits.global import scala.concurrent.duration._ -abstract class SchedulerTimer[F[_]: Effect] { +abstract class SchedulerTimer[F[_]: ConcurrentEffect: Timer] { val scheduler: Timer[F] val duration = 1.second From 2036486060a8c54dae7de13d26d953ae39186756 Mon Sep 17 00:00:00 2001 From: Vasil Vasilev Date: Fri, 21 May 2021 16:29:46 +0200 Subject: [PATCH 07/20] Fix compilation errors in AkkaSink test --- scalafix/build.sbt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scalafix/build.sbt b/scalafix/build.sbt index fe2fcc02de..202edf0f1d 100644 --- a/scalafix/build.sbt +++ b/scalafix/build.sbt @@ -38,7 +38,8 @@ lazy val input = project.settings( lazy val output = project.settings( publish / skip := true, libraryDependencies ++= Seq( - "co.fs2" %% "fs2-core" % "1.0.0" + "co.fs2" %% "fs2-core" % "1.0.0", + "com.typesafe.akka" %% "akka-stream" % "2.5.21" ) ) From a0e7f60eaaa014fc1671abd0dd24bc1e81d0466f Mon Sep 17 00:00:00 2001 From: Vasil Vasilev Date: Fri, 21 May 2021 16:38:53 +0200 Subject: [PATCH 08/20] Fix some compilation errors in ConcurrentDataTypes test --- scalafix/input/src/main/scala/fix/ConcurrentDataTypes.scala | 2 +- scalafix/output/src/main/scala/fix/ConcurrentDataTypes.scala | 5 +++-- scalafix/rules/src/main/scala/fix/v1.scala | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/scalafix/input/src/main/scala/fix/ConcurrentDataTypes.scala b/scalafix/input/src/main/scala/fix/ConcurrentDataTypes.scala index 4748e79238..8bb8e42e6f 100644 --- a/scalafix/input/src/main/scala/fix/ConcurrentDataTypes.scala +++ b/scalafix/input/src/main/scala/fix/ConcurrentDataTypes.scala @@ -12,7 +12,7 @@ import fs2.async.{Ref, refOf, _} import scala.concurrent.ExecutionContext.Implicits.global import scala.concurrent.duration._ -abstract class ConcurrentDataTypes[F[_]: Effect] { +abstract class ConcurrentDataTypes[F[_]: ConcurrentEffect: Timer] { // Ref val ref: F[Ref[F, Int]] = Ref(1) refOf[F, Int](1) diff --git a/scalafix/output/src/main/scala/fix/ConcurrentDataTypes.scala b/scalafix/output/src/main/scala/fix/ConcurrentDataTypes.scala index 02c83681ee..e813321239 100644 --- a/scalafix/output/src/main/scala/fix/ConcurrentDataTypes.scala +++ b/scalafix/output/src/main/scala/fix/ConcurrentDataTypes.scala @@ -10,9 +10,10 @@ import scala.concurrent.ExecutionContext.Implicits.global import scala.concurrent.duration._ import cats.effect.concurrent import cats.effect.concurrent.{ Deferred, Ref, Semaphore } +import cats.effect.syntax.concurrent._ import fs2.concurrent.{ Signal, SignallingRef } -abstract class ConcurrentDataTypes[F[_]: Effect] { +abstract class ConcurrentDataTypes[F[_]: ConcurrentEffect: Timer] { // Ref val ref: F[Ref[F, Int]] = Ref.of(1) Ref.of[F, Int](1) @@ -31,7 +32,7 @@ abstract class ConcurrentDataTypes[F[_]: Effect] { val f2: F[Deferred[F, Int]] = promise e.map(_.get) def scheduler: Timer[F] - e.map(_.timeout(1.second)) + e.map(_.get.timeout(1.second)) // Semaphore val s: F[concurrent.Semaphore[F]] = cats.effect.concurrent.Semaphore(1) diff --git a/scalafix/rules/src/main/scala/fix/v1.scala b/scalafix/rules/src/main/scala/fix/v1.scala index 8f2667ba0a..e5e0d83225 100644 --- a/scalafix/rules/src/main/scala/fix/v1.scala +++ b/scalafix/rules/src/main/scala/fix/v1.scala @@ -168,7 +168,7 @@ object ConcurrentDataTypesRules { case cancellableGetMatcher(Term.Select(_, s)) => Patch.replaceTree(s, "get") case timedGetMatcher(s @ Term.Apply(Term.Select(pre, Term.Name("timedGet")), List(d, _))) => - Patch.replaceTree(s, s"${pre}.timeout($d)") + Patch.replaceTree(s, s"${pre}.get.timeout($d)") + Patch.addGlobalImport(importer"cats.effect.syntax.concurrent._") // Signal case t @ immutableSignalMatcher(_: Term.Name) => From dc4fb68a1216bbd65b95b7ccb752fecdfdf23605 Mon Sep 17 00:00:00 2001 From: Vasil Vasilev Date: Fri, 21 May 2021 16:42:48 +0200 Subject: [PATCH 09/20] Run scalafix tests in the CI --- .github/workflows/ci.yml | 5 +++++ build.sbt | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2efab8f249..6b3ea51ee3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,6 +57,11 @@ jobs: - run: sbt --client '++${{ matrix.scala }}; fmtCheck; test; mimaReportBinaryIssues' + - name: Scalafix tests + run: | + cd scalafix + sbt test + - if: matrix.scala == '2.13.6' run: sbt --client '++${{ matrix.scala }}; microsite/mdoc' diff --git a/build.sbt b/build.sbt index 5f0bb4cb43..a6b33c6d0b 100644 --- a/build.sbt +++ b/build.sbt @@ -28,8 +28,12 @@ ThisBuild / spiewakCiReleaseSnapshots := true ThisBuild / spiewakMainBranches := List("main", "series/2.5.x") ThisBuild / githubWorkflowBuild := Seq( - WorkflowStep.Sbt(List("fmtCheck", "test", "mimaReportBinaryIssues")) + WorkflowStep.Sbt(List("fmtCheck", "test", "mimaReportBinaryIssues")), // WorkflowStep.Sbt(List("coreJVM/it:test")) // Memory leak tests fail intermittently on CI + WorkflowStep.Run( + List("cd scalafix", "sbt test"), + name = Some("Scalafix tests") + ) ) ThisBuild / scmInfo := Some( From 507d9449e1c8609b778e05255651cd2d565cbfdc Mon Sep 17 00:00:00 2001 From: Vasil Vasilev Date: Fri, 21 May 2021 17:04:03 +0200 Subject: [PATCH 10/20] Run scalafix tests on Scala 2.13 only --- .github/workflows/ci.yml | 1 + build.sbt | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6b3ea51ee3..a2ad25e392 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -58,6 +58,7 @@ jobs: - run: sbt --client '++${{ matrix.scala }}; fmtCheck; test; mimaReportBinaryIssues' - name: Scalafix tests + if: matrix.scala == '2.13.5' run: | cd scalafix sbt test diff --git a/build.sbt b/build.sbt index a6b33c6d0b..978442852c 100644 --- a/build.sbt +++ b/build.sbt @@ -19,7 +19,9 @@ ThisBuild / organizationName := "Functional Streams for Scala" ThisBuild / homepage := Some(url("https://github.com/typelevel/fs2")) ThisBuild / startYear := Some(2013) -ThisBuild / crossScalaVersions := Seq("3.0.0", "2.12.14", "2.13.6") +val NewScala = "2.13.6" + +ThisBuild / crossScalaVersions := Seq("3.0.0", "2.12.13", NewScala) ThisBuild / githubWorkflowJavaVersions := Seq("adopt@1.16") @@ -32,7 +34,8 @@ ThisBuild / githubWorkflowBuild := Seq( // WorkflowStep.Sbt(List("coreJVM/it:test")) // Memory leak tests fail intermittently on CI WorkflowStep.Run( List("cd scalafix", "sbt test"), - name = Some("Scalafix tests") + name = Some("Scalafix tests"), + cond = Some(s"matrix.scala == '$NewScala'") ) ) From d540b0516f8bcd12ca740b4b1ebf4ac76df10382 Mon Sep 17 00:00:00 2001 From: Vasil Vasilev Date: Fri, 21 May 2021 17:17:47 +0200 Subject: [PATCH 11/20] Try fixing the target jvm --- scalafix/build.sbt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scalafix/build.sbt b/scalafix/build.sbt index 202edf0f1d..e97606ce3e 100644 --- a/scalafix/build.sbt +++ b/scalafix/build.sbt @@ -15,8 +15,10 @@ inThisBuild( scalaVersion := V.scala212, addCompilerPlugin(scalafixSemanticdb), scalacOptions ++= List( - "-Yrangepos" - ) + "-Yrangepos", + "-target:jvm-1.8" + ), + javacOptions ++= Seq("-source", "1.8", "-target", "1.8") ) ) From 9e831e0499e6b56cf701902d3df0654ff5118ded Mon Sep 17 00:00:00 2001 From: Vasil Vasilev Date: Fri, 21 May 2021 22:02:38 +0200 Subject: [PATCH 12/20] Create a special testCI command to suppress compilation errors in CI --- .github/workflows/ci.yml | 2 +- build.sbt | 2 +- scalafix/build.sbt | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a2ad25e392..d69bf29eef 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -61,7 +61,7 @@ jobs: if: matrix.scala == '2.13.5' run: | cd scalafix - sbt test + sbt testCI - if: matrix.scala == '2.13.6' run: sbt --client '++${{ matrix.scala }}; microsite/mdoc' diff --git a/build.sbt b/build.sbt index 978442852c..d8edcb61f6 100644 --- a/build.sbt +++ b/build.sbt @@ -33,7 +33,7 @@ ThisBuild / githubWorkflowBuild := Seq( WorkflowStep.Sbt(List("fmtCheck", "test", "mimaReportBinaryIssues")), // WorkflowStep.Sbt(List("coreJVM/it:test")) // Memory leak tests fail intermittently on CI WorkflowStep.Run( - List("cd scalafix", "sbt test"), + List("cd scalafix", "sbt testCI"), name = Some("Scalafix tests"), cond = Some(s"matrix.scala == '$NewScala'") ) diff --git a/scalafix/build.sbt b/scalafix/build.sbt index e97606ce3e..bdf2cf19a8 100644 --- a/scalafix/build.sbt +++ b/scalafix/build.sbt @@ -61,3 +61,8 @@ lazy val tests = project ) .dependsOn(rules) .enablePlugins(ScalafixTestkitPlugin) + +addCommandAlias( + "testCI", + "; set (output / Compile / compile / skip) := true; test; set (output / Compile / compile / skip) := false;" +) From 2c168f6e2def236c77bed71155c707b7c7c2d865 Mon Sep 17 00:00:00 2001 From: Vasil Vasilev Date: Fri, 21 May 2021 22:20:24 +0200 Subject: [PATCH 13/20] Roll a custom scalafix workflow --- .github/workflows/scalafix.yml | 40 ++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/scalafix.yml diff --git a/.github/workflows/scalafix.yml b/.github/workflows/scalafix.yml new file mode 100644 index 0000000000..9a3991235c --- /dev/null +++ b/.github/workflows/scalafix.yml @@ -0,0 +1,40 @@ +name: Scalafix tests + +on: + pull_request: + branches: ["*"] + push: + branches: ["*"] + tags: [v*] + +jobs: + build: + name: Run Scalafix tests + runs-on: ubuntu-latest + steps: + - name: Checkout current branch (full) + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Setup Java and Scala + uses: olafurpg/setup-scala@v10 + with: + java-version: adopt@1.11 + + - name: Cache sbt + uses: actions/cache@v2 + with: + path: | + ~/.sbt + ~/.ivy2/cache + ~/.coursier/cache/v1 + ~/.cache/coursier/v1 + ~/AppData/Local/Coursier/Cache/v1 + ~/Library/Caches/Coursier/v1 + key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} + + - name: Scalafix tests + run: | + cd scalafix + sbt testCI From fa25d924a04468e4ea76c5dc41455ca2bc44eaef Mon Sep 17 00:00:00 2001 From: Vasil Vasilev Date: Fri, 21 May 2021 22:23:35 +0200 Subject: [PATCH 14/20] Remove the added scalafix test job --- .github/workflows/ci.yml | 20 +++++++------------- build.sbt | 7 +------ 2 files changed, 8 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d69bf29eef..797e00be2b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - scala: [3.0.0, 2.12.14, 2.13.6] + scala: [3.0.0, 2.12.13, 2.13.6] java: [adopt@1.16] runs-on: ${{ matrix.os }} steps: @@ -57,12 +57,6 @@ jobs: - run: sbt --client '++${{ matrix.scala }}; fmtCheck; test; mimaReportBinaryIssues' - - name: Scalafix tests - if: matrix.scala == '2.13.5' - run: | - cd scalafix - sbt testCI - - if: matrix.scala == '2.13.6' run: sbt --client '++${{ matrix.scala }}; microsite/mdoc' @@ -118,12 +112,12 @@ jobs: tar xf targets.tar rm targets.tar - - name: Download target directories (2.12.14) + - name: Download target directories (2.12.13) uses: actions/download-artifact@v2 with: - name: target-${{ matrix.os }}-2.12.14-${{ matrix.java }} + name: target-${{ matrix.os }}-2.12.13-${{ matrix.java }} - - name: Inflate target directories (2.12.14) + - name: Inflate target directories (2.12.13) run: | tar xf targets.tar rm targets.tar @@ -164,12 +158,12 @@ jobs: tar xf targets.tar rm targets.tar - - name: Download target directories (2.12.14) + - name: Download target directories (2.12.13) uses: actions/download-artifact@v2 with: - name: target-${{ matrix.os }}-2.12.14-${{ matrix.java }} + name: target-${{ matrix.os }}-2.12.13-${{ matrix.java }} - - name: Inflate target directories (2.12.14) + - name: Inflate target directories (2.12.13) run: | tar xf targets.tar rm targets.tar diff --git a/build.sbt b/build.sbt index d8edcb61f6..ecc64f829f 100644 --- a/build.sbt +++ b/build.sbt @@ -30,13 +30,8 @@ ThisBuild / spiewakCiReleaseSnapshots := true ThisBuild / spiewakMainBranches := List("main", "series/2.5.x") ThisBuild / githubWorkflowBuild := Seq( - WorkflowStep.Sbt(List("fmtCheck", "test", "mimaReportBinaryIssues")), + WorkflowStep.Sbt(List("fmtCheck", "test", "mimaReportBinaryIssues")) // WorkflowStep.Sbt(List("coreJVM/it:test")) // Memory leak tests fail intermittently on CI - WorkflowStep.Run( - List("cd scalafix", "sbt testCI"), - name = Some("Scalafix tests"), - cond = Some(s"matrix.scala == '$NewScala'") - ) ) ThisBuild / scmInfo := Some( From 36ca459c2a4fdca9bbc69e482fd7a5d6347085ba Mon Sep 17 00:00:00 2001 From: Vasil Vasilev Date: Mon, 31 May 2021 09:24:12 +0200 Subject: [PATCH 15/20] Remove scalac and javac options --- scalafix/build.sbt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/scalafix/build.sbt b/scalafix/build.sbt index bdf2cf19a8..29f2a0eb97 100644 --- a/scalafix/build.sbt +++ b/scalafix/build.sbt @@ -14,11 +14,7 @@ inThisBuild( ), scalaVersion := V.scala212, addCompilerPlugin(scalafixSemanticdb), - scalacOptions ++= List( - "-Yrangepos", - "-target:jvm-1.8" - ), - javacOptions ++= Seq("-source", "1.8", "-target", "1.8") + scalacOptions ++= List("-Yrangepos") ) ) From 2d6a89623c155ce265e36103da4c17376c23af1c Mon Sep 17 00:00:00 2001 From: Vasil Vasilev Date: Mon, 31 May 2021 09:25:00 +0200 Subject: [PATCH 16/20] Update scalafix to 0.9.29 --- scalafix/project/plugins.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scalafix/project/plugins.sbt b/scalafix/project/plugins.sbt index 665bb90626..56a53c90c3 100644 --- a/scalafix/project/plugins.sbt +++ b/scalafix/project/plugins.sbt @@ -1 +1 @@ -addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.28") +addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.29") From 3f590aec9158b06fcb1fac031e3c623452ed12b2 Mon Sep 17 00:00:00 2001 From: Vasil Vasilev Date: Mon, 31 May 2021 09:37:20 +0200 Subject: [PATCH 17/20] Update to Scala 2.12.14 --- .github/workflows/ci.yml | 14 +++++++------- build.sbt | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 797e00be2b..2efab8f249 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - scala: [3.0.0, 2.12.13, 2.13.6] + scala: [3.0.0, 2.12.14, 2.13.6] java: [adopt@1.16] runs-on: ${{ matrix.os }} steps: @@ -112,12 +112,12 @@ jobs: tar xf targets.tar rm targets.tar - - name: Download target directories (2.12.13) + - name: Download target directories (2.12.14) uses: actions/download-artifact@v2 with: - name: target-${{ matrix.os }}-2.12.13-${{ matrix.java }} + name: target-${{ matrix.os }}-2.12.14-${{ matrix.java }} - - name: Inflate target directories (2.12.13) + - name: Inflate target directories (2.12.14) run: | tar xf targets.tar rm targets.tar @@ -158,12 +158,12 @@ jobs: tar xf targets.tar rm targets.tar - - name: Download target directories (2.12.13) + - name: Download target directories (2.12.14) uses: actions/download-artifact@v2 with: - name: target-${{ matrix.os }}-2.12.13-${{ matrix.java }} + name: target-${{ matrix.os }}-2.12.14-${{ matrix.java }} - - name: Inflate target directories (2.12.13) + - name: Inflate target directories (2.12.14) run: | tar xf targets.tar rm targets.tar diff --git a/build.sbt b/build.sbt index ecc64f829f..a313289080 100644 --- a/build.sbt +++ b/build.sbt @@ -21,7 +21,7 @@ ThisBuild / startYear := Some(2013) val NewScala = "2.13.6" -ThisBuild / crossScalaVersions := Seq("3.0.0", "2.12.13", NewScala) +ThisBuild / crossScalaVersions := Seq("3.0.0", "2.12.14", NewScala) ThisBuild / githubWorkflowJavaVersions := Seq("adopt@1.16") From cd39a2b7995483b1cf7a3fa4a70af2f400b054d7 Mon Sep 17 00:00:00 2001 From: Vasil Vasilev Date: Mon, 31 May 2021 09:50:55 +0200 Subject: [PATCH 18/20] Run the scalafix tests in the main CI on JDK 16 --- .github/workflows/ci.yml | 6 ++++++ build.sbt | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2efab8f249..6e9dd2e9f3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,6 +57,12 @@ jobs: - run: sbt --client '++${{ matrix.scala }}; fmtCheck; test; mimaReportBinaryIssues' + - name: Scalafix tests + if: matrix.scala == '2.13.6' + run: | + cd scalafix + sbt testCI + - if: matrix.scala == '2.13.6' run: sbt --client '++${{ matrix.scala }}; microsite/mdoc' diff --git a/build.sbt b/build.sbt index a313289080..41381d15cf 100644 --- a/build.sbt +++ b/build.sbt @@ -30,8 +30,13 @@ ThisBuild / spiewakCiReleaseSnapshots := true ThisBuild / spiewakMainBranches := List("main", "series/2.5.x") ThisBuild / githubWorkflowBuild := Seq( - WorkflowStep.Sbt(List("fmtCheck", "test", "mimaReportBinaryIssues")) + WorkflowStep.Sbt(List("fmtCheck", "test", "mimaReportBinaryIssues")), // WorkflowStep.Sbt(List("coreJVM/it:test")) // Memory leak tests fail intermittently on CI + WorkflowStep.Run( + List("cd scalafix", "sbt testCI"), + name = Some("Scalafix tests"), + cond = Some(s"matrix.scala == '$NewScala'") + ) ) ThisBuild / scmInfo := Some( From 15cb8b016489e7d7fac649a58ccb3bdc8dc4382f Mon Sep 17 00:00:00 2001 From: Vasil Vasilev Date: Mon, 31 May 2021 09:51:34 +0200 Subject: [PATCH 19/20] Remove the scalafix workflow --- .github/workflows/scalafix.yml | 40 ---------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 .github/workflows/scalafix.yml diff --git a/.github/workflows/scalafix.yml b/.github/workflows/scalafix.yml deleted file mode 100644 index 9a3991235c..0000000000 --- a/.github/workflows/scalafix.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Scalafix tests - -on: - pull_request: - branches: ["*"] - push: - branches: ["*"] - tags: [v*] - -jobs: - build: - name: Run Scalafix tests - runs-on: ubuntu-latest - steps: - - name: Checkout current branch (full) - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Setup Java and Scala - uses: olafurpg/setup-scala@v10 - with: - java-version: adopt@1.11 - - - name: Cache sbt - uses: actions/cache@v2 - with: - path: | - ~/.sbt - ~/.ivy2/cache - ~/.coursier/cache/v1 - ~/.cache/coursier/v1 - ~/AppData/Local/Coursier/Cache/v1 - ~/Library/Caches/Coursier/v1 - key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} - - - name: Scalafix tests - run: | - cd scalafix - sbt testCI From 40abee98c92de52aa207263a62e68b822b7622c7 Mon Sep 17 00:00:00 2001 From: Vasil Vasilev Date: Tue, 1 Jun 2021 10:05:28 +0200 Subject: [PATCH 20/20] Update scalafix subproject sbt to 1.5.3 --- scalafix/project/build.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scalafix/project/build.properties b/scalafix/project/build.properties index 19479ba46f..67d27a1dfe 100644 --- a/scalafix/project/build.properties +++ b/scalafix/project/build.properties @@ -1 +1 @@ -sbt.version=1.5.2 +sbt.version=1.5.3