From 7f09ed02484f1596c61b2ef9047795ee817bee37 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Fri, 10 Nov 2023 19:08:13 +0100 Subject: [PATCH 1/2] Improve gh-actions output by folding integration-test output --- internal/integrationtest/arduino-cli.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/internal/integrationtest/arduino-cli.go b/internal/integrationtest/arduino-cli.go index bf240fc19bd..2f1f7c57842 100644 --- a/internal/integrationtest/arduino-cli.go +++ b/internal/integrationtest/arduino-cli.go @@ -298,6 +298,13 @@ func (cli *ArduinoCLI) run(stdoutBuff, stderrBuff io.Writer, stdinBuff io.Reader if cli.cliConfigPath != nil { args = append([]string{"--config-file", cli.cliConfigPath.String()}, args...) } + + // Github-actions workflow tags to fold log lines + if os.Getenv("GITHUB_ACTIONS") != "" { + fmt.Printf("::group::Running %s\n", strings.Join(args, " ")) + defer fmt.Println("::endgroup::") + } + fmt.Println(color.HiBlackString(">>> Running: ") + color.HiYellowString("%s %s", cli.path, strings.Join(args, " "))) cliProc, err := executils.NewProcessFromPath(cli.convertEnvForExecutils(env), cli.path, args...) cli.t.NoError(err) From e887512ff14ee77938f786f4b0a923270e7b2fa8 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Fri, 10 Nov 2023 19:19:53 +0100 Subject: [PATCH 2/2] Reduce build verbosity (not needed in GH actions logs) --- Taskfile.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Taskfile.yml b/Taskfile.yml index a3a8d5ab5a0..0616b126024 100755 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -48,7 +48,7 @@ tasks: desc: Build the Go code dir: '{{default "./" .GO_MODULE_PATH}}' cmds: - - go build -v {{default "" .EXTRA_FLAGS}} {{.LDFLAGS}} + - go build {{default "" .EXTRA_FLAGS}} {{.LDFLAGS}} # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/deploy-cobra-mkdocs-versioned-poetry/Taskfile.yml go:cli-docs: