binary size checking hooks
This commit is contained in:
parent
af5ec51a36
commit
863b4a58fe
1
.github/workflows/cli.yml
vendored
1
.github/workflows/cli.yml
vendored
@ -46,6 +46,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
go run internal/build/build.go vet
|
go run internal/build/build.go vet
|
||||||
go run internal/build/build.go test
|
go run internal/build/build.go test
|
||||||
|
go run internal/build/build.go check-binary-size
|
||||||
|
|
||||||
- name: Upload coverage to Codecov
|
- name: Upload coverage to Codecov
|
||||||
if: success() && matrix.go == 1.13 && matrix.os == 'ubuntu-latest'
|
if: success() && matrix.go == 1.13 && matrix.os == 'ubuntu-latest'
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
//+build ignore
|
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
@ -40,6 +38,10 @@ func main() {
|
|||||||
Name: "toc",
|
Name: "toc",
|
||||||
Action: TocActionFunc,
|
Action: TocActionFunc,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Name: "check-binary-size",
|
||||||
|
Action: checkBinarySizeActionFunc,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
err := app.Run(os.Args)
|
err := app.Run(os.Args)
|
||||||
@ -178,3 +180,12 @@ func TocActionFunc(c *cli.Context) error {
|
|||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func checkBinarySizeActionFunc(c *cli.Context) (err error) {
|
||||||
|
err = runCmd("git", "diff", "--exit-code")
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user