.travis.yml 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. language: go
  2. go_import_path: github.com/newrelic/go-agent
  3. go:
  4. - "1.3"
  5. - "1.4"
  6. - "1.5"
  7. - "1.6"
  8. - "1.7"
  9. - "1.8"
  10. - "1.9"
  11. - "1.10"
  12. - "1.11"
  13. # Skip the install step. Don't `go get` dependencies. Only build with the
  14. # code in vendor/
  15. install: true
  16. # golint requires a supported version of Go, which in practice is currently 1.9+.
  17. # See: https://github.com/golang/lint#installation
  18. # For simplicity, run it on a single Go version: 1.11
  19. # Also, only run gofmt on 1.11: The format output changed from 1.10 to 1.11.
  20. before_script:
  21. - GO_FILES=$(find . -iname '*.go' -type f | grep -v /vendor/)
  22. - DO_GOLINT=$(if [[ "$TRAVIS_GO_VERSION" = "1.11" ]]; then echo "0"; else echo "1"; fi)
  23. - DO_GOFMT=$(if [[ "$TRAVIS_GO_VERSION" = "1.11" ]]; then echo "0"; else echo "1"; fi)
  24. - if [[ "$DO_GOLINT" -eq "0" ]]; then go get -u golang.org/x/lint/golint; fi
  25. script:
  26. - if [ "$DO_GOFMT" -eq 0 ] && [ -n "$(gofmt -s -l $GO_FILES)" ]; then exit 1; fi; # gofmt
  27. - go test -v -race ./... # go test
  28. - go vet ./... # go vet
  29. - if [ "$DO_GOLINT" -eq 0 ]; then golint -set_exit_status $(go list ./...); fi # golint