on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - '**'

name: Go
jobs:
  test:
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest]
        go_version: ["1.14.9", "1.15.2"]
    runs-on: ${{ matrix.os }}
    steps:
    - name: Checkout code
      uses: actions/checkout@v2
    - name: Install Go
      uses: actions/setup-go@v2
      with:
        go-version: ${{ matrix.go_version }}
    - name: Generate
      run: go generate ./...
    - name: Test
      run: go test ./...
    - name: Verify clean commit
      run: test -z "$(git status --porcelain)" || (git status; git diff; false)
