image: golang:1.11beta2
pipelines:
default:
- step:
caches:
- bin
- bench
script:
- export PATH="/gosrc/bin:$PATH"
- mkdir -p "$GOPATH/bin"
- cp -r /gobin/* "$GOPATH/bin/" || true
- '[[ -e "$GOPATH/bin/benchcmp" ]] || GO111MODULE=off go get -u golang.org/x/tools/cmd/benchcmp'
- mkdir -p "/bench"
- mv /bench/new.txt /bench/old.txt || true
- go version
- go env
- go vet ./...
- go test -race ./...
- go test -cover ./...
- go test -run=NONE -bench . -benchmem ./... | tee /bench/new.txt
- '[[ -e /bench/old.txt ]] && benchcmp /bench/old.txt /bench/new.txt'
- cp -r "$GOPATH/bin" /gobin || true
definitions:
caches:
bin: /gobin
bench: /bench