language: go
sudo: false

matrix:
  include:
    - go: 1.11.x
      env: GO111MODULE=on
    - go: 1.12.x
      env: GO111MODULE=off
    - go: 1.12.x
      env: GO111MODULE=on
    - go: 1.13.x
      env:
      - GO111MODULE=on
      - VET=1
    - go: 1.14.x
      env: GO111MODULE=on
    - go: tip
      env: GO111MODULE=on

# accomodate forks
before_install:
  - mkdir -p $TRAVIS_BUILD_DIR $GOPATH/src/github.com/jhump
  - test ! -d $GOPATH/src/github.com/jhump/protoreflect && mv $TRAVIS_BUILD_DIR $GOPATH/src/github.com/jhump/protoreflect || true

script:
  - if [[ "$VET" = 1 ]]; then make ci; else make deps test; fi
