mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 05:06:43 +00:00
build: run lint/tests for all modules in workspace
This commit is contained in:
parent
2e27b91a87
commit
eb17939542
1 changed files with 17 additions and 3 deletions
20
build/ci.go
20
build/ci.go
|
|
@ -64,6 +64,12 @@ import (
|
|||
)
|
||||
|
||||
var (
|
||||
// List of go modules for linting/testing/etc.
|
||||
workspaceModules = []string{
|
||||
".",
|
||||
"./cmd/keeper",
|
||||
}
|
||||
|
||||
// Files that end up in the geth*.zip archive.
|
||||
gethArchiveFiles = []string{
|
||||
"COPYING",
|
||||
|
|
@ -322,7 +328,7 @@ func doTest(cmdline []string) {
|
|||
gotest.Args = append(gotest.Args, "-short")
|
||||
}
|
||||
|
||||
packages := []string{"./..."}
|
||||
packages := workspacePackagePatterns()
|
||||
if len(flag.CommandLine.Args()) > 0 {
|
||||
packages = flag.CommandLine.Args()
|
||||
}
|
||||
|
|
@ -364,7 +370,7 @@ func doCheckGenerate() {
|
|||
protocPath = downloadProtoc(*cachedir)
|
||||
protocGenGoPath = downloadProtocGenGo(*cachedir)
|
||||
)
|
||||
c := tc.Go("generate", "./...")
|
||||
c := tc.Go("generate", workspacePackagePatterns()...)
|
||||
pathList := []string{filepath.Join(protocPath, "bin"), protocGenGoPath, os.Getenv("PATH")}
|
||||
c.Env = append(c.Env, "PATH="+strings.Join(pathList, string(os.PathListSeparator)))
|
||||
build.MustRun(c)
|
||||
|
|
@ -424,7 +430,7 @@ func doLint(cmdline []string) {
|
|||
cachedir = flag.String("cachedir", "./build/cache", "directory for caching golangci-lint binary.")
|
||||
)
|
||||
flag.CommandLine.Parse(cmdline)
|
||||
packages := []string{"./..."}
|
||||
packages := workspacePackagePatterns()
|
||||
if len(flag.CommandLine.Args()) > 0 {
|
||||
packages = flag.CommandLine.Args()
|
||||
}
|
||||
|
|
@ -1169,3 +1175,11 @@ func doSanityCheck() {
|
|||
csdb := download.MustLoadChecksums("build/checksums.txt")
|
||||
csdb.DownloadAndVerifyAll()
|
||||
}
|
||||
|
||||
func workspacePackagePatterns() []string {
|
||||
p := make([]string, len(workspaceModules))
|
||||
for i := range workspaceModules {
|
||||
p[i] = workspaceModules[i] + "/..."
|
||||
}
|
||||
return p
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue