Add travisci config

This commit is contained in:
Jannis Mattheis 2018-01-27 21:04:00 +01:00
parent 11422e53a8
commit a520ab28c9
2 changed files with 42 additions and 0 deletions

30
.travis.yml Normal file
View File

@ -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)

12
all-test-with-coverage.sh Normal file
View File

@ -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