language: go

env:
  - WITH_COVERAGE=true
  - GOFLAGS='-race'

go_import_path: github.com/google/monologue

matrix:
  fast_finish: true

install:
  - go get -d -t ./...
  # 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:
  - set -e
  - ./scripts/presubmit.sh ${WITH_COVERAGE:+--coverage}
  - set +e

after_success:
  # Upload coverage info as per https://docs.codecov.io/docs/about-the-codecov-bash-uploader
  - bash <(curl -s https://codecov.io/bash)

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

jobs:
  include:
    - 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:
  - go get -d -t ./...
  # 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:
  - set -e
  - ./scripts/presubmit.sh ${WITH_COVERAGE:+--coverage}
  - set +e


Refactor Travis config to use jobs
Refactor Travis config to use jobs

This clears the way to add a `go mod tidy` job.
