version: ~> 1.0
language: go
go_import_path: github.com/google/monologue
go:
  - 1.13

env:
  global:
    - GO111MODULE=on

jobs:
  include:
    - name: go mod tidy
      install: skip
      before_script: go mod tidy -v
      script: git diff --exit-code -- go.mod go.sum
    - name: test with coverage
      env:
        - WITH_COVERAGE=true
      after_success:
        # Upload coverage info as per https://docs.codecov.io/docs/about-the-codecov-bash-uploader
        - bash <(curl -s https://codecov.io/bash)
    - name: test with race detection
      env:
        - GOFLAGS='-race'

install:
  # Install golangci-lint as per https://github.com/golangci/golangci-lint#install
  - curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.18.0

script:
  - ./scripts/presubmit.sh ${WITH_COVERAGE:+--coverage}


version: ~> 1.0
language: go
go_import_path: github.com/google/monologue
go:
  - 1.13

cache:
  directories:
    - $GOPATH/pkg/mod

env:
  global:
    - GO111MODULE=on

jobs:
  include:
    - name: go mod tidy
      install: skip
      before_script: go mod tidy -v
      script: git diff --exit-code -- go.mod go.sum
    - name: test with coverage
      env:
        - WITH_COVERAGE=true
      after_success:
        # Upload coverage info as per https://docs.codecov.io/docs/about-the-codecov-bash-uploader
        - bash <(curl -s https://codecov.io/bash)
    - name: test with race detection
      env:
        - GOFLAGS='-race'

install:
  # Install golangci-lint as per https://github.com/golangci/golangci-lint#install
  - curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.18.0

script:
  - ./scripts/presubmit.sh ${WITH_COVERAGE:+--coverage}


Make Travis cache the directory where Go Modules are stored
Make Travis cache the directory where Go Modules are stored

This saves it having to repeatedly download the same modules, which
will make builds faster.
