From 505dd41d2297415c320f0e93cfef4ec593899205 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Tue, 26 Apr 2022 18:52:43 -0700 Subject: [PATCH] ci: test newly added tag We run test with the tag set (to make sure nothing is broken). Signed-off-by: Kir Kolyshkin --- .github/workflows/cli.yml | 1 + build.go | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml index 91c8aa533e..8a95009e93 100644 --- a/.github/workflows/cli.yml +++ b/.github/workflows/cli.yml @@ -34,4 +34,5 @@ jobs: run: go run build.go vet go run build.go test + go run build.go -tags urfave_cli_no_docs test go run build.go toc docs/v1/manual.md diff --git a/build.go b/build.go index a78ded358f..08cf7bbc21 100644 --- a/build.go +++ b/build.go @@ -41,6 +41,12 @@ func main() { Action: TocActionFunc, }, } + app.Flags = []cli.Flag{ + &cli.StringFlag{ + Name: "tags", + Usage: "set build tags", + }, + } err := app.Run(os.Args) if err != nil { @@ -63,6 +69,8 @@ func VetActionFunc(_ *cli.Context) error { } func TestActionFunc(c *cli.Context) error { + tags := c.String("tags") + for _, pkg := range packages { var packageName string @@ -74,7 +82,7 @@ func TestActionFunc(c *cli.Context) error { coverProfile := fmt.Sprintf("--coverprofile=%s.coverprofile", pkg) - err := runCmd("go", "test", "-v", coverProfile, packageName) + err := runCmd("go", "test", "-tags", tags, "-v", coverProfile, packageName) if err != nil { return err }