1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
# Copyright 2014 Marc-Antoine Ruel. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
sudo: false
language: go
dist: xenial
matrix:
include:
- go: 1.12.x
env: GO111MODULE=on
cache:
directories:
# go1.10+ 'go test' cache on linux (macOS and Windows are # different).
- $HOME/.cache/go-build
# go1.11+ with GO111MODULE=on
- $GOPATH/pkg/mod
# Cache tools sources. Manually verified that both misspell and ineffassign
# only depend on the stdlib.
- $GOPATH/src/github\.com/client9
- $GOPATH/src/github\.com/gordonklaus
# For shadow.
- $GOPATH/src/golang\.org
- go: 1.8.7
before_script:
- echo $TRAVIS_GO_VERSION
- if [[ $TRAVIS_GO_VERSION != 1.8.7 ]]; then go get -u -v github.com/client9/misspell/cmd/misspell github.com/gordonklaus/ineffassign golang.org/x/lint/golint golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow; fi
script:
# Checks run on the latest version.
- if [[ $TRAVIS_GO_VERSION != 1.8.7 ]]; then echo 'Check Code is well formatted'; ! gofmt -s -d . | read; fi
- if [[ $TRAVIS_GO_VERSION != 1.8.7 ]]; then go list ./... | grep -v /vendor/ | xargs -L1 golint -set_exit_status; fi
- if [[ $TRAVIS_GO_VERSION != 1.8.7 ]]; then go vet ./...; fi
- if [[ $TRAVIS_GO_VERSION != 1.8.7 ]]; then ineffassign .; fi
- if [[ $TRAVIS_GO_VERSION != 1.8.7 ]]; then go vet -vettool=$GOPATH/bin/shadow; fi
- if [[ $TRAVIS_GO_VERSION != 1.8.7 ]]; then bash -c 'set -e; echo "" > coverage.txt; for d in $(go list ./...); do go test -covermode=count -coverprofile=p.out $d; if [ -f p.out ]; then cat p.out >> coverage.txt; rm p.out; fi; done'; fi
- if [[ $TRAVIS_GO_VERSION != 1.8.7 ]]; then go test -race ./...; fi
# Check run on older versions.
- if [[ $TRAVIS_GO_VERSION == 1.8.7 ]]; then go test ./...; fi
- if [[ $TRAVIS_GO_VERSION == 1.8.7 ]]; then if find . -path ./.git -prune -o -type f -executable -print | grep -e . ; then echo 'Do not commit executables'; false; fi; fi
after_success:
- if [[ $TRAVIS_GO_VERSION != 1.8.7 ]]; then bash <(curl -s https://codecov.io/bash); fi
|