name: code quality

on:
  workflow_dispatch:
  pull_request:
  push:
    branches:
      - main
  schedule:
    - cron: "0 6 * * 1" # monday 06:00 UTC

permissions: {}

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  codeql:
    runs-on: ubuntu-latest
    permissions:
      security-events: write
      contents: read
    steps:
      - uses: actions/checkout@v7
      - name: set up go
        uses: actions/setup-go@v7
        with:
          go-version: "1.25"
      - name: initialize codeql
        uses: github/codeql-action/init@v4
        with:
          languages: go
      - name: build
        run: go build ./...
      - name: perform codeql analysis
        uses: github/codeql-action/analyze@v4
        with:
          category: "/language:go"
