name: Test

on:
  push:
    branches:
      - "*"
  pull_request:
    branches:
      - "*"

jobs:
  test:
    strategy:
      matrix:
        platform: [ ubuntu-latest, windows-latest ]
    runs-on: ${{ matrix.platform }}
    steps:
      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd

      - name: Set up Go
        uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417
        with:
          go-version: 1.25

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

      - name: Set up gotestsum
        run: |
          go install gotest.tools/gotestsum@latest

      - name: Test
        run: |
          gotestsum --raw-command -- go test -json ./... --race

      - name: Validate Config
        run: go generate ./... && git diff --exit-code
