name: Run tests

on: [ push, pull_request ]

permissions:
  contents: read

jobs:
  test:
    strategy:
      matrix:
        version: [ '1.18', '1.19', '1.20', '1.21', '1.22', '1.23', '1.24' ]
        platform: [ ubuntu-latest, macos-latest, windows-latest ]
    runs-on: ${{ matrix.platform }}
    steps:
    - name: Install Go
      uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
      with:
        go-version: ${{ matrix.version }}
    - name: Checkout code
      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
    - name: Build
      run: go build -v ./...
    - name: Test
      run: go test -v -race ./...
