Skip to content

Commit

Permalink
ci: test newly added tag
Browse files Browse the repository at this point in the history
We run test with the tag set (to make sure nothing is broken).

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
  • Loading branch information
kolyshkin committed May 4, 2022
1 parent fc47b1a commit 2930925
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 9 additions & 1 deletion build.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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

Expand All @@ -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
}
Expand Down

0 comments on commit 2930925

Please sign in to comment.