name: Go CI

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

jobs:
  verify:
    name: Verify & Test
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Code
        uses: actions/checkout@v4

      - name: Setup Go
        uses: actions/setup-go@v5
        with:
          go-version: "1.26"
          cache: true

      - name: GolangCI-Lint (Formatting, Linters & Imports)
        uses: golangci/golangci-lint-action@v6
        with:
          version: v1.64.5

      - name: Test with Race Detector
        run: go test -race -coverprofile=coverage.out -covermode=atomic ./...

      - name: Go Vet & Vulnerability Scan
        uses: golang/govulncheck-action@v1
        with:
          go-version-input: "1.26"
          check-latest: true
