1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2024-12-25 17:27:25 +00:00

Merge pull request #1373 from restic/check-gopkg-lock

CI: Check the vendor dir and Gopkg.lock
This commit is contained in:
Alexander Neumann 2017-10-21 11:14:30 +02:00
commit cacaa4393f

View file

@ -94,6 +94,7 @@ func (env *TravisEnvironment) Prepare() error {
"golang.org/x/tools/cmd/cover", "golang.org/x/tools/cmd/cover",
"github.com/pierrre/gotestcover", "github.com/pierrre/gotestcover",
"github.com/NebulousLabs/glyphcheck", "github.com/NebulousLabs/glyphcheck",
"github.com/golang/dep/cmd/dep",
"github.com/restic/rest-server/cmd/rest-server", "github.com/restic/rest-server/cmd/rest-server",
} }
@ -250,6 +251,10 @@ func (env *TravisEnvironment) RunTests() error {
return err return err
} }
if err = runDep(); err != nil {
return err
}
if err = runGlyphcheck(); err != nil { if err = runGlyphcheck(); err != nil {
return err return err
} }
@ -409,6 +414,19 @@ func runGofmt() error {
return nil 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 { func runGlyphcheck() error {
cmd := exec.Command("glyphcheck", "./cmd/...", "./internal/...") cmd := exec.Command("glyphcheck", "./cmd/...", "./internal/...")
cmd.Stderr = os.Stderr cmd.Stderr = os.Stderr