# Once https://github.com/actions/setup-go/pull/34 is finished, we can remove
# travis.ci altogether and move everything to Github Action.
language: go

go_import_path: github.com/google/pprof

matrix:
  include:
    - os: linux
      go: master
    - os: osx
      osx_image: xcode10.3
      go: master
    - os: osx
      osx_image: xcode11
      go: master
    - os: osx
      osx_image: xcode11.1
      go: master
    - os: osx
      osx_image: xcode11.2
      go: master
    - os: osx
      osx_image: xcode11.3
      go: master
    - os: osx
      osx_image: xcode11.4
      go: master
    - os: osx
      osx_image: xcode11.5
      go: master
    - os: osx
      osx_image: xcode11.6
      go: master

addons:
  apt:
    packages:
      - graphviz
  homebrew:
    packages:
      - graphviz
    update: true
 
before_install:
  # Do not let tools interfere with the main module's go.mod
  - env GO111MODULE=off go get -u golang.org/x/lint/golint honnef.co/go/tools/cmd/...

script:
  - gofmtdiff=$(gofmt -s -d .) && if [ -n "$gofmtdiff" ]; then printf 'gofmt -s found:\n%s\n' "$gofmtdiff" && exit 1; fi
  - golintlint=$(golint ./...) && if [ -n "$golintlint" ]; then printf 'golint found:\n%s\n' "$golintlint" && exit 1; fi
  - go vet -all ./...
  - ./test.sh

  # Check still works in GOPATH mode.
  - env GO111MODULE=off go get -d . && go test -v ./...

after_success:
  - bash <(curl -s https://codecov.io/bash)
