travis: test against latest releases.

While here, clean up goclean.sh.
This commit is contained in:
David Hill 2017-01-15 08:38:08 -05:00
parent 5ce0ed6009
commit e15ac5024a
2 changed files with 18 additions and 9 deletions

View file

@ -1,11 +1,10 @@
language: go language: go
go: go:
- 1.6.3 - 1.6.x
- 1.7 - 1.7.x
sudo: false sudo: false
install: install:
- go get -d -t -v ./... - go get -d -t -v ./...
- go get -v golang.org/x/tools/cmd/cover
- go get -v github.com/alecthomas/gometalinter - go get -v github.com/alecthomas/gometalinter
- gometalinter --install - gometalinter --install
script: script:

View file

@ -6,30 +6,40 @@
# 4. go vet (http://golang.org/cmd/vet) # 4. go vet (http://golang.org/cmd/vet)
# 5. gosimple (https://github.com/dominikh/go-simple) # 5. gosimple (https://github.com/dominikh/go-simple)
# 6. unconvert (https://github.com/mdempsky/unconvert) # 6. unconvert (https://github.com/mdempsky/unconvert)
# 7. test coverage (http://blog.golang.org/cover) # 7. race detector (http://blog.golang.org/race-detector)
# 8. test coverage (http://blog.golang.org/cover)
# #
# gometalinter (github.com/alecthomas/gometalinter) is used to run each each # gometalinter (github.com/alecthomas/gometalinter) is used to run each static
# static checker. # checker.
set -e set -ex
# Make sure gometalinter is installed and $GOPATH/bin is in your path.
# $ go get -v github.com/alecthomas/gometalinter"
# $ gometalinter --install"
if [ ! -x "$(type -p gometalinter)" ]; then
exit 1
fi
# Automatic checks # Automatic checks
test -z "$(gometalinter --disable-all \ test -z "$(gometalinter --disable-all \
--enable=gofmt \ --enable=gofmt \
--enable=goimports \
--enable=golint \ --enable=golint \
--enable=vet \ --enable=vet \
--enable=gosimple \ --enable=gosimple \
--enable=unconvert \ --enable=unconvert \
--enable=goimports \
--deadline=45s ./... | tee /dev/stderr)" --deadline=45s ./... | tee /dev/stderr)"
env GORACE="halt_on_error=1" go test -race ./... env GORACE="halt_on_error=1" go test -race ./...
# Run test coverage on each subdirectories and merge the coverage profile. # Run test coverage on each subdirectories and merge the coverage profile.
set +x
echo "mode: count" > profile.cov echo "mode: count" > profile.cov
# Standard go tooling behavior is to ignore dirs with leading underscores. # Standard go tooling behavior is to ignore dirs with leading underscores.
for dir in $(find . -maxdepth 10 -not -path './.git*' -not -path '*/_*' -type d); for dir in $(find . -maxdepth 10 -not -path '.' -not -path './.git*' \
-not -path '*/_*' -type d);
do do
if ls $dir/*.go &> /dev/null; then if ls $dir/*.go &> /dev/null; then
go test -covermode=count -coverprofile=$dir/profile.tmp $dir go test -covermode=count -coverprofile=$dir/profile.tmp $dir