name: Go Versions

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  build:
    name: Go versions
    runs-on: ubuntu-latest

    strategy:
      matrix:
        go-version: [1.21.x, 1.22.x, stable]

    steps:
    - uses: actions/checkout@v5

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

    - name: Install dependencies
      run: go mod tidy

    - name: Run tests
      run: go test ./...
