name: PR

on:
  pull_request:
    branches: [ master ]

jobs:

  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        go: [
          '1.20',
          '1.19',
          '1.18',
          '1.17',
          '1.16',
          '1.15',
          '1.14',
          '1.13',
        ]
    name: Go ${{ matrix.go }}.x PR Validate
    steps:
    - uses: actions/checkout@v3

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

    - name: Version
      run: go version

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

    - name: Test
      run: go test -v -cover -race -cpu 1,2,4 ./...
