# Copyright 2019 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

dist: bionic
sudo: false

language: go
go:
  - "1.11.x"
  - "1.12.x"
  - "1.13.x"
  - "master"

os:
  - linux
  - osx

env:
  - GO111MODULE=on

branches:
  only:
    - master

matrix:
  allow_failures:
    - os: osx

  fast_finish: true

before_script:
  - go build ./...
  # Install dependencies for testing.
  - go get github.com/golang/mock/gomock@v1.4.0
  - go get github.com/golang/mock/mockgen@v1.4.0
  # Generate the mocks for testing.
  - go generate ./...

script:
  - make test VERBOSE=1

# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

dist: bionic

language: go
go:
  - "1.11.x"
  - "1.12.x"
  - "1.13.x"
  - "1.14.x"

os:
  - linux
  - osx

env:
  - GO111MODULE=on

branches:
  only:
    - master

matrix:
  allow_failures:
    - os: osx

  fast_finish: true

before_script:
  - go build ./...
  # Install dependencies for testing.
  - go get github.com/golang/mock/gomock@v1.4.0
  - go get github.com/golang/mock/mockgen@v1.4.0
  # Generate the mocks for testing.
  - go generate ./...

script:
  - make test VERBOSE=1

Build with Go 1.14, drop Go source build
Build with Go 1.14, drop Go source build

The prebuilt versions are so much faster (~40-50 sec.) than the source build
(~3.5 min) that it is not worth it, especially since we're not using or relying
on any features that are being added/removed on the Go trunk. This saves us a
bit of time waiting for tests to turn green on PRs prior to merge.

Additional minor fixes:

* s/Google Inc./Google LLC/
* removed deprecated `sudo: false` setting
