name: Run tests

on: [ push, pull_request ]

permissions:
  contents: read

jobs:
  test:
    strategy:
      matrix:
        version: [ '1.18', '1.19', '1.20', '1.21.0-rc.4' ]
        platform: [ ubuntu-latest, macos-latest, windows-latest ]
    runs-on: ${{ matrix.platform }}
    steps:
    - name: Install Go
      uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
      with:
        go-version: ${{ matrix.version }}
    - name: Checkout code
      uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
    - name: Build
      run: go build -v ./...
    - name: Test
      run: go test -v -race ./...
