github.com/CloudCom/goose@v0.0.0-20151110184009-e03c3249c21b/.travis.yml (about)

     1  language: go
     2  
     3  go:
     4    - 1.5
     5    - 1.4
     6    - tip
     7  
     8  matrix:
     9    allow_failures:
    10      - go: tip
    11    fast_finish: true
    12  
    13  services:
    14    - mysql
    15    - postgresql
    16  
    17  before_install:
    18    - go get github.com/axw/gocov/gocov
    19    - go get github.com/mattn/goveralls
    20    # install linting tools
    21    - go get github.com/golang/lint/golint
    22    - go get golang.org/x/tools/cmd/vet
    23    - go get github.com/fzipp/gocyclo
    24  
    25  install:
    26    - go get -t -d ./...
    27  
    28  before_script:
    29    - psql -U postgres -c 'CREATE DATABASE goose'
    30    - export POSTGRES_DATABASE_DSN='host=localhost sslmode=disable user=postgres dbname=goose'
    31    - mysql -u root -e 'CREATE DATABASE goose'
    32    - export MYSQL_DATABASE_DSN='root@tcp(localhost:3306)/goose'
    33    - |
    34      if [[ -n "$REDSHIFT_DATABASE_DSN" ]]; then
    35        export "$(go run travis.setup_redshift.go setup)" && \
    36          trap "go run travis.setup_redshift.go destroy" EXIT
    37      fi
    38  
    39  script:
    40    # check for potentially complex functions
    41    - "gocyclo -over 15 . ||:"
    42    # check possible styling errors
    43    - "golint ./... ||:"
    44    # make sure code is properly formatted and simplified
    45    - test -z "$(gofmt -d . | tee /dev/stderr)"
    46    # check for possible uh ohs
    47    - go vet ./...
    48    # make sure generated files have already been committed
    49    - go generate ./... && test -z "$(git status --porcelain)"
    50    - go build -i ./...
    51    # run tests checking for race conditions
    52    - go list ./... | xargs -n 1 go test -v -race -coverprofile=>(sed -e '1!{/^mode:/d}' > .coverprofile)
    53  
    54  after_script:
    55    - goveralls -coverprofile=.coverprofile
    56  
    57  after_success:
    58    - |
    59      if [[ "$TRAVIS_PULL_REQUEST" == "false" ]] && [[ "$TRAVIS_BRANCH" == "master" ]]; then
    60        go list ./... | xargs -n 1 -I{} curl http://godoc.org/-/refresh -d path={}
    61      fi