language: go
go:
  - 1.9

jdk:
  - oraclejdk9

sudo: false

branches:
  only:
    - master

before_install:
  - wget http://apache.cs.utah.edu/zookeeper/zookeeper-${zk_version}/zookeeper-${zk_version}.tar.gz
  - tar -zxvf zookeeper*tar.gz && zip -d zookeeper-${zk_version}/contrib/fatjar/zookeeper-${zk_version}-fatjar.jar 'META-INF/*.SF' 'META-INF/*.DSA'
  - go get github.com/mattn/goveralls
  - go get golang.org/x/tools/cmd/cover

script:
  - jdk_switcher use oraclejdk9
  - go build ./...
  - go fmt ./...
  - go vet ./...
  - go test -i -race ./...
  - go test -race -covermode atomic -coverprofile=profile.cov ./zk
  - goveralls -coverprofile=profile.cov -service=travis-ci

env:
  global:
    secure: Coha3DDcXmsekrHCZlKvRAc+pMBaQU1QS/3++3YCCUXVDBWgVsC1ZIc9df4RLdZ/ncGd86eoRq/S+zyn1XbnqK5+ePqwJoUnJ59BE8ZyHLWI9ajVn3fND1MTduu/ksGsS79+IYbdVI5wgjSgjD3Ktp6Y5uPl+BPosjYBGdNcHS4=
  matrix:
    - zk_version=3.4.10
