name: Go

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:

  build:
    name: Build
    runs-on: ubuntu-latest
    strategy:
      matrix:
        go: ['1.9', '1.10', '1.11', '1.12', '1.13', '1.14']
    steps:

    - name: Set up Go ${{ matrix.go }}
      uses: actions/setup-go@v2
      with:
        go-version: ${{ matrix.go }}
      id: go

    - name: Check out code into the Go module directory
      uses: actions/checkout@v2

    - name: Get dependencies
      run: |
        go get -v -t -d ./...
        if [ -f Gopkg.toml ]; then
            curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
            dep ensure
        fi

    - name: Build
      run: go build -v ./...

    - name: Test
      run: go test -v ./...
    
    - name: Race Test
      run: go test -race ./...
    
    - name: Check gofmt
      run: diff -u <(echo -n) <(gofmt -d -s .)
    
    - name: Coverage
      run: ./scripts/coverage.sh

name: Go

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:

  build:
    name: Build
    runs-on: ubuntu-latest
    strategy:
      matrix:
        go: ['1.12', '1.13', '1.14']
    steps:

    - name: Set up Go ${{ matrix.go }}
      uses: actions/setup-go@v2
      with:
        go-version: ${{ matrix.go }}
      id: go

    - name: Check out code into the Go module directory
      uses: actions/checkout@v2

    - name: Get dependencies
      run: |
        go get -v -t -d ./...
        if [ -f Gopkg.toml ]; then
            curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
            dep ensure
        fi

    - name: Build
      run: go build -v ./...

    - name: Test
      run: go test -v ./...
    
    - name: Race Test
      run: go test -race ./...
    
    - name: Check gofmt
      run: diff -u <(echo -n) <(gofmt -d -s .)
    
    - name: Coverage
      run: ./scripts/coverage.sh

Update Go versions to run CI for.
Update Go versions to run CI for.

Remove `1.11` and earlier.