name: CodeQL

on:
  push:
    branches:
      - '*'
  pull_request:
    branches:
      - '*'
  schedule:
    - cron: '36 11 * * 6'

jobs:
  analyze:
    name: Analyze
    runs-on: ubuntu-latest
    permissions:
      actions: read
      contents: read
      security-events: write

    strategy:
      fail-fast: false
      matrix:
        language: [ 'cpp' ]

    steps:
    - name: Checkout repository
      uses: actions/checkout@v5

    # Initializes the CodeQL tools for scanning.
    - name: Initialize CodeQL
      uses: github/codeql-action/init@v4
      with:
        languages: ${{ matrix.language }}

    # Attempt to build any compiled languages  (C/C++, C#, or Java).
    - run: make clean all

    # Analysis
    - name: Perform CodeQL Analysis
      uses: github/codeql-action/analyze@v4
