name: Go presubmit

on:
  push:
    branches:
      - main
  pull_request:
    types: [opened, reopened, synchronize]

jobs:
  build:
    name: Go presubmit
    runs-on: ubuntu-latest
    strategy:
      matrix:
        go-version: ['1.19', '1.20', '1.21']
    steps:
    - name: Install Go ${{ matrix.go-version }}
      uses: actions/setup-go@v4
      with:
        go-version: ${{ matrix.go-version }}
    - uses: actions/checkout@v4
    - uses: creachadair/go-presubmit-action@v2
      with:
        staticcheck-version: "2023.1.6"
