Skip to content

Commit caf7800

Browse files
committed
build: run lint/tests for all modules in workspace
1 parent 017c60c commit caf7800

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

build/ci.go

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ import (
6464
)
6565

6666
var (
67+
// List of go modules for linting/testing/etc.
68+
workspaceModules = []string{
69+
".",
70+
"./cmd/keeper",
71+
}
72+
6773
// Files that end up in the geth*.zip archive.
6874
gethArchiveFiles = []string{
6975
"COPYING",
@@ -322,7 +328,7 @@ func doTest(cmdline []string) {
322328
gotest.Args = append(gotest.Args, "-short")
323329
}
324330

325-
packages := []string{"./..."}
331+
packages := workspacePackagePatterns()
326332
if len(flag.CommandLine.Args()) > 0 {
327333
packages = flag.CommandLine.Args()
328334
}
@@ -364,7 +370,7 @@ func doCheckGenerate() {
364370
protocPath = downloadProtoc(*cachedir)
365371
protocGenGoPath = downloadProtocGenGo(*cachedir)
366372
)
367-
c := tc.Go("generate", "./...")
373+
c := tc.Go("generate", workspacePackagePatterns()...)
368374
pathList := []string{filepath.Join(protocPath, "bin"), protocGenGoPath, os.Getenv("PATH")}
369375
c.Env = append(c.Env, "PATH="+strings.Join(pathList, string(os.PathListSeparator)))
370376
build.MustRun(c)
@@ -424,7 +430,7 @@ func doLint(cmdline []string) {
424430
cachedir = flag.String("cachedir", "./build/cache", "directory for caching golangci-lint binary.")
425431
)
426432
flag.CommandLine.Parse(cmdline)
427-
packages := []string{"./..."}
433+
packages := workspacePackagePatterns()
428434
if len(flag.CommandLine.Args()) > 0 {
429435
packages = flag.CommandLine.Args()
430436
}
@@ -1169,3 +1175,11 @@ func doSanityCheck() {
11691175
csdb := download.MustLoadChecksums("build/checksums.txt")
11701176
csdb.DownloadAndVerifyAll()
11711177
}
1178+
1179+
func workspacePackagePatterns() []string {
1180+
p := make([]string, len(workspaceModules))
1181+
for i := range workspaceModules {
1182+
p[i] = workspaceModules[i] + "/..."
1183+
}
1184+
return p
1185+
}

0 commit comments

Comments
 (0)