Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ jobs:

- name: Check that workflows are up to date
shell: bash
run: sbt '++ ${{ matrix.scala }}' githubWorkflowCheck
run: sbt '++ ${{ matrix.scala }}; githubWorkflowCheck'

- if: matrix.java != 'zulu@8'
shell: bash
run: sbt '++ ${{ matrix.scala }}' '+ test' '+ scripted'
run: sbt '++ ${{ matrix.scala }}; + test; + scripted'

- if: matrix.java == 'zulu@8'
shell: bash
run: sbt '++ ${{ matrix.scala }}' test scripted
run: sbt '++ ${{ matrix.scala }}; test; scripted'

- name: Clean up Ivy Local repo
shell: bash
Expand Down
16 changes: 5 additions & 11 deletions src/main/scala/sbtghactions/GenerativePlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -281,18 +281,12 @@ ${indent(rendered.mkString("\n"), 1)}"""
case sbtStep: Sbt =>
import sbtStep.commands

val sbtClientMode = sbt.matches("""sbt.* --client($| .*)""")
val safeCommands = if (sbtClientMode)
s"'${(sbtStepPreamble ::: commands).mkString("; ")}'"
else (sbtStepPreamble ::: commands).map { c =>
if (c.indexOf(' ') >= 0)
s"'$c'"
else
c
}.mkString(" ")

val multi = (sbtStepPreamble ::: commands) match {
case x :: Nil => x
case xs => s"'${xs.mkString("; ")}'"
}
renderRunBody(
commands = List(s"$sbt $safeCommands"),
commands = List(s"$sbt $multi"),
params = sbtStep.params,
renderedShell = renderedShell
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ jobs:
uses: sbt/setup-sbt@v1

- name: Check that workflows are up to date
run: sbt '++ ${{ matrix.scala }}' githubWorkflowCheck
run: sbt '++ ${{ matrix.scala }}; githubWorkflowCheck'

- name: Build project
run: sbt '++ ${{ matrix.scala }}' test
run: sbt '++ ${{ matrix.scala }}; test'

- name: Compress target directories
run: tar cf targets.tar target project/target
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ jobs:
uses: sbt/setup-sbt@v1

- name: Check that workflows are up to date
run: sbt '++ ${{ matrix.scala }}' githubWorkflowCheck
run: sbt '++ ${{ matrix.scala }}; githubWorkflowCheck'

- name: Build project
run: sbt '++ ${{ matrix.scala }}' test
run: sbt '++ ${{ matrix.scala }}; test'

- run: echo yo

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ jobs:

- name: Check that workflows are up to date
shell: bash
run: sbt '++ ${{ matrix.scala }}' githubWorkflowCheck
run: sbt '++ ${{ matrix.scala }}; githubWorkflowCheck'

- name: Build project
shell: bash
run: sbt '++ ${{ matrix.scala }}' test
run: sbt '++ ${{ matrix.scala }}; test'

- name: Compress target directories
shell: bash
Expand Down
4 changes: 2 additions & 2 deletions src/sbt-test/sbtghactions/no-clean/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ jobs:
uses: sbt/setup-sbt@v1

- name: Check that workflows are up to date
run: sbt '++ ${{ matrix.scala }}' githubWorkflowCheck
run: sbt '++ ${{ matrix.scala }}; githubWorkflowCheck'

- name: Build project
run: sbt '++ ${{ matrix.scala }}' test
run: sbt '++ ${{ matrix.scala }}; test'

- name: Compress target directories
run: tar cf targets.tar target project/target
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ jobs:
uses: sbt/setup-sbt@v1

- name: Check that workflows are up to date
run: sbt '++ ${{ matrix.scala }}' githubWorkflowCheck
run: sbt '++ ${{ matrix.scala }}; githubWorkflowCheck'

- run: sbt '++ ${{ matrix.scala }}' withTarget/compile
- run: sbt '++ ${{ matrix.scala }}; withTarget/compile'

- name: Compress target directories
run: tar cf targets.tar target withTarget/target project/target
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,4 @@ jobs:
rm targets.tar

- name: Publish project
run: sbt --client '+publish'
run: sbt --client +publish
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ jobs:
uses: sbt/setup-sbt@v1

- name: Check that workflows are up to date
run: sbt '++ ${{ matrix.scala }}' githubWorkflowCheck
run: sbt '++ ${{ matrix.scala }}; githubWorkflowCheck'

- name: Build project
run: sbt '++ ${{ matrix.scala }}' test
run: sbt '++ ${{ matrix.scala }}; test'

- name: Compress target directories
run: tar cf targets.tar target project/target
Expand Down
6 changes: 3 additions & 3 deletions src/test/scala/sbtghactions/GenerativePluginSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ class GenerativePluginSpec extends Specification {
"compile sbt using the command provided" in {
compileStep(
Sbt(List("show scalaVersion", "compile", "test")),
"$SBT") mustEqual s"- run: $$SBT '++ $${{ matrix.scala }}' 'show scalaVersion' compile test"
"$SBT") mustEqual s"- run: $$SBT '++ $${{ matrix.scala }}; show scalaVersion; compile; test'"
}

"compile sbt without switch command" in {
Expand All @@ -444,7 +444,7 @@ class GenerativePluginSpec extends Specification {
"compile sbt with parameters" in {
compileStep(
Sbt(List("compile", "test"), params = Map("abc" -> "def", "cafe" -> "@42")),
"$SBT") mustEqual s"""- run: $$SBT '++ $${{ matrix.scala }}' compile test
"$SBT") mustEqual s"""- run: $$SBT '++ $${{ matrix.scala }}; compile; test'
| with:
| abc: def
| cafe: '@42'""".stripMargin
Expand Down Expand Up @@ -699,7 +699,7 @@ class GenerativePluginSpec extends Specification {
env:
not: now
steps:
- run: csbt '++ $${{ matrix.scala }}' +compile"""
- run: csbt '++ $${{ matrix.scala }}; +compile'"""
}

"compile a job with an environment" in {
Expand Down
Loading