language: go
services:
  - mysql
  - mongodb

env:
  - MYSQL_TEST="true" MONGO_TEST="true"

go:
  - 1.7.3
  - tip

matrix:
  allow_failures:
    - go: tip

before_install:
  - go get -v github.com/golang/lint/golint

install:
  - go version

before_script:
  - mysql < db/seed.sql
  - mongo db/seed.js

sudo: false
script:
  - go build -v ./cmd/cashier ./cmd/cashierd
  - go list ./... |grep -v vendor/ |xargs go test
  - gofmt -d $(find -type f -name '*.go' -not -path './vendor/*')
  - go list ./... |grep -v vendor/ |xargs go vet
  - go list ./... |grep -v vendor/ |xargs -L1 golint -set_exit_status
