name: CI

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

jobs:
  # Lint job
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - uses: golangci/golangci-lint-action@v9
        with:
          version: v2.12.2
          args: --timeout 5m

  # Test job
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - uses: actions/setup-go@v6
        with:
          go-version: '1.26.0'
      - run: go test ./... -v

  # Security scan job
  security:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - uses: securego/gosec@v2.26.1
        with:
          args: ./...
