diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml index c2924e1..c9fa616 100644 --- a/.github/workflows/cli.yml +++ b/.github/workflows/cli.yml @@ -46,6 +46,7 @@ jobs: run: | go run internal/build/build.go vet go run internal/build/build.go test + go run internal/build/build.go check-binary-size - name: Upload coverage to Codecov if: success() && matrix.go == 1.13 && matrix.os == 'ubuntu-latest' diff --git a/internal/build/build.go b/internal/build/build.go index 5a6415a..df3bd88 100644 --- a/internal/build/build.go +++ b/internal/build/build.go @@ -1,5 +1,3 @@ -//+build ignore - package main import ( @@ -40,6 +38,10 @@ func main() { Name: "toc", Action: TocActionFunc, }, + { + Name: "check-binary-size", + Action: checkBinarySizeActionFunc, + }, } err := app.Run(os.Args) @@ -178,3 +180,12 @@ func TocActionFunc(c *cli.Context) error { return nil } + +func checkBinarySizeActionFunc(c *cli.Context) (err error) { + err = runCmd("git", "diff", "--exit-code") + if err != nil { + return err + } + + return nil +}