language: go

go:
  - "1.13.x"

# Only clone the most recent commit.
# Ref: https://docs.travis-ci.com/user/customizing-the-build/#git-clone-depth
git:
  depth: 3

# Setup caching of dependencies
cache:
  directories:
    - $HOME/.cache/go-build
    - $HOME/gopath/pkg/mod

install: skip

jobs:
  - name: "unit tests"
    before_script:
      # Install CodeClimate test reporter
      - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
      - chmod +x ./cc-test-reporter
      - ./cc-test-reporter before-build

    script:
      - go test -v -race -coverprofile c.out ./...

    after_script:
      - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT

# Matrix/Riot webhook notifications
notifications:
  email: false
  webhooks:
    # This is a bit overly verbose right now (link previews...)
    # urls:
    #     - "https://scalar.vector.im/api/neb/services/hooks/dHJhdmlzLWNpLyU0MGRva3RlcmJvYiUzQWNoYXQud2Voby5zdC8lMjFNR1pUZWlZUm9XZllmSmxMckUlM0FjaGF0LndlaG8uc3Q"
    on_success: change  # always|never|change
    on_failure: always
    on_start: never

language: go

go:
  - "1.13.x"

# Setup caching of dependencies
cache:
  directories:
    - $HOME/.cache/go-build
    - $HOME/gopath/pkg/mod

install: go get -v ./...

before_script:
  # Install CodeClimate test reporter
  - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
  - chmod +x ./cc-test-reporter
  - ./cc-test-reporter before-build

script:
  - go test -v -race -coverprofile c.out ./...

after_script:
  - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT

# Matrix/Riot webhook notifications
notifications:
  email: false
  webhooks:
    # This is a bit overly verbose right now (link previews...)
    # urls:
    #     - "https://scalar.vector.im/api/neb/services/hooks/dHJhdmlzLWNpLyU0MGRva3RlcmJvYiUzQWNoYXQud2Voby5zdC8lMjFNR1pUZWlZUm9XZllmSmxMckUlM0FjaGF0LndlaG8uc3Q"
    on_success: change  # always|never|change
    on_failure: always
    on_start: never

Simplify Travis config, separate get & test.
Simplify Travis config, separate get & test.