Skip to content
This repository has been archived by the owner on May 25, 2020. It is now read-only.

Commit

Permalink
update travis
Browse files Browse the repository at this point in the history
  • Loading branch information
pqv199x authored and thanhnguyennguyen committed Nov 11, 2019
1 parent 2ad834d commit 0c6a34c
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 26 deletions.
14 changes: 10 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,25 @@ sudo: required
language: go
go_import_path: github.com/ethereum/go-ethereum

env:
global:
- GOPROXY=https://proxy.golang.org
- GO111MODULE=on


jobs:
include:

- stage: Lint
sudo: false
go: '1.10'
go: '1.12'
git:
submodules: false
script:
- go run build/ci.go lint

- stage: Build and test
go: '1.11'
go: '1.12'
script:
- sudo modprobe fuse
- sudo chmod 666 /dev/fuse
Expand All @@ -23,7 +29,7 @@ jobs:
- while sleep 540; do echo "[ still running ]"; done &
- go run build/ci.go test -coverage
- kill %1
- go: '1.10'
- go: '1.11'
script:
- sudo modprobe fuse
- sudo chmod 666 /dev/fuse
Expand All @@ -34,7 +40,7 @@ jobs:
- kill %1

- stage: Github release
go: '1.10'
go: '1.11'
script:
- make tomo-cross
deploy:
Expand Down
30 changes: 15 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,30 @@ GO_FILES := $(shell find $(shell go list -f '{{.Dir}}' $(GO_PACKAGES)) -name \*.
GIT = git

tomo:
build/env.sh go run build/ci.go install ./cmd/tomo
go run build/ci.go install ./cmd/tomo
@echo "Done building."
@echo "Run \"$(GOBIN)/tomo\" to launch tomo."

gc:
build/env.sh go run build/ci.go install ./cmd/gc
go run build/ci.go install ./cmd/gc
@echo "Done building."
@echo "Run \"$(GOBIN)/gc\" to launch gc."

bootnode:
build/env.sh go run build/ci.go install ./cmd/bootnode
go run build/ci.go install ./cmd/bootnode
@echo "Done building."
@echo "Run \"$(GOBIN)/bootnode\" to launch a bootnode."

puppeth:
build/env.sh go run build/ci.go install ./cmd/puppeth
go run build/ci.go install ./cmd/puppeth
@echo "Done building."
@echo "Run \"$(GOBIN)/puppeth\" to launch puppeth."

all:
build/env.sh go run build/ci.go install
go run build/ci.go install

test: all
build/env.sh go run build/ci.go test
go run build/ci.go test

clean:
rm -fr build/_workspace/pkg/ $(GOBIN)/*
Expand All @@ -50,32 +50,32 @@ tomo-linux: tomo-linux-386 tomo-linux-amd64 tomo-linux-mips64 tomo-linux-mips64l
@ls -ld $(GOBIN)/tomo-linux-*

tomo-linux-386:
build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=linux/386 -v ./cmd/tomo
go run build/ci.go xgo -- --go=$(GO) --targets=linux/386 -v ./cmd/tomo
@echo "Linux 386 cross compilation done:"
@ls -ld $(GOBIN)/tomo-linux-* | grep 386

tomo-linux-amd64:
build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=linux/amd64 -v ./cmd/tomo
go run build/ci.go xgo -- --go=$(GO) --targets=linux/amd64 -v ./cmd/tomo
@echo "Linux amd64 cross compilation done:"
@ls -ld $(GOBIN)/tomo-linux-* | grep amd64

tomo-linux-mips:
build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=linux/mips --ldflags '-extldflags "-static"' -v ./cmd/tomo
go run build/ci.go xgo -- --go=$(GO) --targets=linux/mips --ldflags '-extldflags "-static"' -v ./cmd/tomo
@echo "Linux MIPS cross compilation done:"
@ls -ld $(GOBIN)/tomo-linux-* | grep mips

tomo-linux-mipsle:
build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=linux/mipsle --ldflags '-extldflags "-static"' -v ./cmd/tomo
go run build/ci.go xgo -- --go=$(GO) --targets=linux/mipsle --ldflags '-extldflags "-static"' -v ./cmd/tomo
@echo "Linux MIPSle cross compilation done:"
@ls -ld $(GOBIN)/tomo-linux-* | grep mipsle

tomo-linux-mips64:
build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=linux/mips64 --ldflags '-extldflags "-static"' -v ./cmd/tomo
go run build/ci.go xgo -- --go=$(GO) --targets=linux/mips64 --ldflags '-extldflags "-static"' -v ./cmd/tomo
@echo "Linux MIPS64 cross compilation done:"
@ls -ld $(GOBIN)/tomo-linux-* | grep mips64

tomo-linux-mips64le:
build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=linux/mips64le --ldflags '-extldflags "-static"' -v ./cmd/tomo
go run build/ci.go xgo -- --go=$(GO) --targets=linux/mips64le --ldflags '-extldflags "-static"' -v ./cmd/tomo
@echo "Linux MIPS64le cross compilation done:"
@ls -ld $(GOBIN)/tomo-linux-* | grep mips64le

Expand All @@ -84,17 +84,17 @@ tomo-darwin: tomo-darwin-386 tomo-darwin-amd64
@ls -ld $(GOBIN)/tomo-darwin-*

tomo-darwin-386:
build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=darwin/386 -v ./cmd/tomo
go run build/ci.go xgo -- --go=$(GO) --targets=darwin/386 -v ./cmd/tomo
@echo "Darwin 386 cross compilation done:"
@ls -ld $(GOBIN)/tomo-darwin-* | grep 386

tomo-darwin-amd64:
build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=darwin/amd64 -v ./cmd/tomo
go run build/ci.go xgo -- --go=$(GO) --targets=darwin/amd64 -v ./cmd/tomo
@echo "Darwin amd64 cross compilation done:"
@ls -ld $(GOBIN)/tomo-darwin-* | grep amd64

tomo-windows-amd64:
build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=windows/amd64 -v ./cmd/tomo
go run build/ci.go xgo -- --go=$(GO) --targets=windows/amd64 -v ./cmd/tomo
@echo "Darwin amd64 cross compilation done:"
@ls -ld $(GOBIN)/tomo-windows-* | grep amd64
gofmt:
Expand Down
12 changes: 5 additions & 7 deletions build/ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,34 +242,32 @@ func doTest(cmdline []string) {
build.MustRun(gotest)
}

// runs gometalinter on requested packages
func doLint(cmdline []string) {
flag.CommandLine.Parse(cmdline)

packages := []string{"./..."}
if len(flag.CommandLine.Args()) > 0 {
packages = flag.CommandLine.Args()
}
// Get metalinter and install all supported linters
build.MustRun(goTool("get", "gopkg.in/alecthomas/gometalinter.v2"))
build.MustRunCommand(filepath.Join(GOBIN, "gometalinter.v2"), "--install")
// Get golangci-lint and install all supported linters
build.MustRun(goTool("get", "github.com/golangci/golangci-lint/cmd/[email protected]"))

// Run fast linters batched together
configs := []string{
"--vendor",
"run",
"--disable-all",
"--enable=vet",
"--enable=gofmt",
"--enable=misspell",
"--enable=goconst",
"--min-occurrences=6", // for goconst
}
build.MustRunCommand(filepath.Join(GOBIN, "gometalinter.v2"), append(configs, packages...)...)
build.MustRunCommand(filepath.Join(GOBIN, "golangci-lint"), append(configs, packages...)...)

// Run slow linters one by one
for _, linter := range []string{"unconvert", "gosimple"} {
configs = []string{"--vendor", "--deadline=10m", "--disable-all", "--enable=" + linter}
build.MustRunCommand(filepath.Join(GOBIN, "gometalinter.v2"), append(configs, packages...)...)
build.MustRunCommand(filepath.Join(GOBIN, "golangci-lint"), append(configs, packages...)...)
}
}

Expand Down

0 comments on commit 0c6a34c

Please sign in to comment.