-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.travis.yml
21 lines (17 loc) · 869 Bytes
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
language: go
go:
- 1.12.x
before_script:
- GO_FILES=$(find . -iname '*.go' -type f | grep -v /vendor/) # All the .go files, excluding vendor/
- go get golang.org/x/lint/golint # Linter
- go get github.com/fzipp/gocyclo
# script always run to completion (set +e). All of these code checks are must haves
# in a modern Go project.
script:
- test -z $(gofmt -s -l $GO_FILES) # Fail if a .go file hasn't been formatted with gofmt
- go test -race -coverprofile=coverage.txt -covermode=atomic ./... # Run all the tests with the race detector enabled
- go vet ./... # go vet is the official Go static analyzer
- gocyclo -over 19 $GO_FILES # forbid code with huge functions
- golint $(go list ./...) # one last linter
after_success:
- bash <(curl -s https://codecov.io/bash)