Add travisci config
This commit is contained in:
parent
11422e53a8
commit
a520ab28c9
|
|
@ -0,0 +1,30 @@
|
||||||
|
language: go
|
||||||
|
go:
|
||||||
|
- 1.9
|
||||||
|
|
||||||
|
notifications:
|
||||||
|
email: false
|
||||||
|
|
||||||
|
env:
|
||||||
|
- DEP_VERSION="0.4.1"
|
||||||
|
|
||||||
|
before_install:
|
||||||
|
- curl -L -s https://github.com/golang/dep/releases/download/v${DEP_VERSION}/dep-linux-amd64 -o $GOPATH/bin/dep
|
||||||
|
- chmod +x $GOPATH/bin/dep
|
||||||
|
- chmod +x ./all-test-with-coverage.sh
|
||||||
|
|
||||||
|
install:
|
||||||
|
- dep ensure
|
||||||
|
- go get github.com/golang/lint/golint
|
||||||
|
- go get honnef.co/go/tools/cmd/megacheck
|
||||||
|
- go get github.com/fzipp/gocyclo
|
||||||
|
|
||||||
|
script:
|
||||||
|
- ./all-test-with-coverage.sh
|
||||||
|
- go vet ./...
|
||||||
|
- megacheck ./...
|
||||||
|
- gocyclo -over 10 $(find . -iname '*.go' -type f | grep -v /vendor/)
|
||||||
|
# - golint -set_exit_status $(go list ./...)
|
||||||
|
|
||||||
|
after_success:
|
||||||
|
- bash <(curl -s https://codecov.io/bash)
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
echo "" > coverage.txt
|
||||||
|
|
||||||
|
for d in $(go list ./... | grep -v vendor); do
|
||||||
|
go test -v -coverprofile=profile.out -covermode=atomic $d
|
||||||
|
if [ -f profile.out ]; then
|
||||||
|
cat profile.out >> coverage.txt
|
||||||
|
rm profile.out
|
||||||
|
fi
|
||||||
|
done
|
||||||
Loading…
Reference in New Issue