This repository has been archived by the owner on Oct 13, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy path.travis.yml
54 lines (46 loc) · 1.54 KB
/
.travis.yml
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
47
48
49
50
51
52
53
54
language: go
go:
- 1.6
- 1.5
services:
- mysql
- postgresql
before_install:
- go get github.com/axw/gocov/gocov
- go get github.com/mattn/goveralls
# install linting tools
- go get github.com/golang/lint/golint
- go get github.com/fzipp/gocyclo
install:
- go get -t -d ./...
before_script:
- psql -U postgres -c 'CREATE DATABASE goose'
- export POSTGRES_DATABASE_DSN='host=localhost sslmode=disable user=postgres dbname=goose'
- mysql -u root -e 'CREATE DATABASE goose'
- export MYSQL_DATABASE_DSN='root@tcp(localhost:3306)/goose'
- |
if [[ -n "$REDSHIFT_DATABASE_DSN" ]]; then
export "$(go run travis.setup_redshift.go setup)" && \
trap "go run travis.setup_redshift.go destroy" EXIT
fi
script:
# check for potentially complex functions
- "gocyclo -over 15 . ||:"
# check possible styling errors
- "golint ./... ||:"
# make sure code is properly formatted and simplified
- test -z "$(gofmt -d . | tee /dev/stderr)"
# check for possible uh ohs
- go vet ./...
# make sure generated files have already been committed
- go generate ./... && test -z "$(git status --porcelain)"
- go build -i ./...
# run tests checking for race conditions
- go list ./... | xargs -n 1 go test -v -race -coverprofile=>(sed -e '1!{/^mode:/d}' > .coverprofile)
after_script:
- goveralls -coverprofile=.coverprofile
after_success:
- |
if [[ "$TRAVIS_PULL_REQUEST" == "false" ]] && [[ "$TRAVIS_BRANCH" == "master" ]]; then
go list ./... | xargs -n 1 -I{} curl http://godoc.org/-/refresh -d path={}
fi