mirror of
https://github.com/octoleo/restic.git
synced 2024-11-24 21:57:41 +00:00
CI: Check the vendor dir and Gopkg.lock
This commit is contained in:
parent
f5bbbc52f4
commit
ca6daec8dd
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user