Skip to content

Commit 7f09ed0

Browse files
committed
Improve gh-actions output by folding integration-test output
1 parent 17f0189 commit 7f09ed0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

internal/integrationtest/arduino-cli.go

+7
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,13 @@ func (cli *ArduinoCLI) run(stdoutBuff, stderrBuff io.Writer, stdinBuff io.Reader
298298
if cli.cliConfigPath != nil {
299299
args = append([]string{"--config-file", cli.cliConfigPath.String()}, args...)
300300
}
301+
302+
// Github-actions workflow tags to fold log lines
303+
if os.Getenv("GITHUB_ACTIONS") != "" {
304+
fmt.Printf("::group::Running %s\n", strings.Join(args, " "))
305+
defer fmt.Println("::endgroup::")
306+
}
307+
301308
fmt.Println(color.HiBlackString(">>> Running: ") + color.HiYellowString("%s %s", cli.path, strings.Join(args, " ")))
302309
cliProc, err := executils.NewProcessFromPath(cli.convertEnvForExecutils(env), cli.path, args...)
303310
cli.t.NoError(err)

0 commit comments

Comments
 (0)