name: Go CI

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

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Set up Go
        uses: actions/setup-go@v5
        with:
          go-version: "1.22" # Specify your Go version

      - name: Install golangci-lint
        uses: golangci/golangci-lint-action@v6
        with:
          # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
          version: latest # Or pin to a specific version like v1.58.1

      - name: Display Go version
        run: go version

      - name: Display golangci-lint version
        run: golangci-lint --version

      - name: Build
        run: make build

      - name: Lint
        run: make lint # Uses .golangci.yml configuration


    # - name: Test # Uncomment when tests are added
    #   run: make test
