sudo: required

services:
  - docker

language: go
go:
  - "1.12"

env:
  - GO111MODULE=on

cache:
  directories:
    - ${HOME}/source

before_install:
  - pushd ${HOME}/source
  - if [[ ! -d "./snips-v0.2.8" ]]; then
      wget https://github.com/yunify/snips/releases/download/v0.2.8/snips-v0.2.8-linux_amd64.tar.gz &&
      mkdir snips-v0.2.8 &&
      pushd snips-v0.2.8 &&
      tar -vxzf ../snips-v0.2.8-linux_amd64.tar.gz &&
      popd;
    fi
  - pushd snips-v0.2.8 && sudo cp snips /usr/local/bin && popd
  - popd

install:
  - go get -u golang.org/x/lint/golint;
  - git submodule init

before_script:
  - make update
  - make generate

script:
  - make check
  - make build test test-coverage
