1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2024-12-22 07:43:03 +00:00

CI: Check the vendor dir and Gopkg.lock

This commit is contained in:
Alexander Neumann 2017-10-21 10:18:22 +02:00
parent f5bbbc52f4
commit ca6daec8dd

View file

@ -94,6 +94,7 @@ func (env *TravisEnvironment) Prepare() error {
"golang.org/x/tools/cmd/cover",
"github.com/pierrre/gotestcover",
"github.com/NebulousLabs/glyphcheck",
"github.com/golang/dep/cmd/dep",
"github.com/restic/rest-server/cmd/rest-server",
}
@ -250,6 +251,10 @@ func (env *TravisEnvironment) RunTests() error {
return err
}
if err = runDep(); err != nil {
return err
}
if err = runGlyphcheck(); err != nil {
return err
}
@ -409,6 +414,19 @@ func runGofmt() error {
return nil
}
func runDep() error {
cmd := exec.Command("dep", "ensure", "-no-vendor", "-dry-run")
cmd.Stderr = os.Stderr
cmd.Stdout = os.Stdout
err := cmd.Run()
if err != nil {
return fmt.Errorf("error running dep: %v\nThis probably means that Gopkg.lock is not up to date, run 'dep ensure' and commit all changes", err)
}
return nil
}
func runGlyphcheck() error {
cmd := exec.Command("glyphcheck", "./cmd/...", "./internal/...")
cmd.Stderr = os.Stderr