Skip to content

Commit

Permalink
parallelize scripted
Browse files Browse the repository at this point in the history
scriptedBatchExecution effectively ignores custom build.properties, so this
takes a different approach, running one sbt version per execution, spread
over JDK versions for simplicity.
  • Loading branch information
bjaglin committed Apr 24, 2024
1 parent 8ccbaa8 commit 749823f
Show file tree
Hide file tree
Showing 42 changed files with 19 additions and 16 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
- uses: coursier/setup-action@v1
with:
jvm: temurin:8
- run: rm -rf src/sbt-test/skip-sbt1.4
- run: sbt test scripted
jdk11:
name: JDK11 tests
Expand All @@ -22,6 +23,7 @@ jobs:
- uses: coursier/setup-action@v1
with:
jvm: temurin:11
- run: rm -rf src/sbt-test/skip-sbt1.4
- run: sbt test scripted
jdk17:
name: JDK17 tests
Expand All @@ -31,7 +33,10 @@ jobs:
- uses: coursier/setup-action@v1
with:
jvm: temurin:17
- run: sbt "test; scripted sbt-*/* skip-windows/*"
- run: rm -rf src/sbt-test/skip-java17+
- run: rm -rf src/sbt-test/skip-sbt1.4
- run: sbt test scripted

jdk21:
name: JDK21 tests
runs-on: ubuntu-latest
Expand All @@ -40,14 +45,17 @@ jobs:
- uses: coursier/setup-action@v1
with:
jvm: temurin:21
- run: sbt "test; scripted sbt-scalafix/* skip-windows/*"
- run: rm -rf src/sbt-test/skip-java17+
- run: sbt test scripted
windows:
name: Windows tests
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: coursier/setup-action@v1
- run: sbt ci-windows
- run: rm -r -fo src\sbt-test\skip-sbt1.4
- run: rm -r -fo src\sbt-test\skip-windows
- run: sbt test-skip-windows scripted
shell: bash
checks:
name: Scalafmt
Expand Down
9 changes: 4 additions & 5 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ developers := List(
)
)

commands += Command.command("ci-windows") { s =>
commands += Command.command("test-skip-windows") { s =>
"testOnly -- -l SkipWindows" ::
"scripted sbt-*/*" ::
s
}

Expand All @@ -56,9 +55,7 @@ scriptedSbt := {
if (jdk >= 21)
"1.9.0" // first release that supports JDK21
else
// https://github.com/sbt/sbt/commit/3b9b200
// 1.4.[0-2] force batch mode which is not compatible with custom build.properties
"1.4.3"
(pluginCrossBuild / sbtVersion).value
}

libraryDependencies += compilerPlugin(scalafixSemanticdb)
Expand All @@ -75,6 +72,8 @@ scalacOptions ++= List(
enablePlugins(ScriptedPlugin)
sbtPlugin := true
scriptedBufferLog := false
scriptedBatchExecution := true
scriptedParallelInstances := 2
scriptedLaunchOpts ++= Seq(
"-Xmx2048M",
s"-Dplugin.version=${version.value}",
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion src/sbt-test/sbt-1.5/scala-3/build.sbt

This file was deleted.

1 change: 0 additions & 1 deletion src/sbt-test/sbt-1.5/scala-3/project/build.properties

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion src/sbt-test/sbt-1.5/testkit/project/build.properties

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import _root_.scalafix.sbt.{BuildInfo => Versions}

val scala3Version = "3.3.0"
val scala3Version = "3.3.1"
ThisBuild / semanticdbEnabled := true
ThisBuild / semanticdbVersion := scalafixSemanticdb.revision

Expand Down
1 change: 1 addition & 0 deletions src/sbt-test/skip-sbt1.4/scala-3/build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
scalaVersion := "3.3.1"
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ lazy val scala212 = project
lazy val scala3 = project
.in(file("scala3"))
.settings(
scalaVersion := "3.0.0-RC3" // built-in support for semanticdb
scalaVersion := "3.3.1" // built-in support for semanticdb
)
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
lazy val V = _root_.scalafix.sbt.BuildInfo

lazy val rulesCrossVersions = Seq(V.scala213, V.scala212)
lazy val scala3Version = "3.0.0"
lazy val scala3Version = "3.3.1"

inThisBuild(
List(
Expand Down
File renamed without changes.

0 comments on commit 749823f

Please sign in to comment.