binary size checking hooks

This commit is contained in:
Lynn 2020-02-28 23:19:43 -08:00
parent af5ec51a36
commit 863b4a58fe
No known key found for this signature in database
GPG Key ID: 9E60BEE0555C367B
2 changed files with 14 additions and 2 deletions

View File

@ -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'

View File

@ -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
}