name: "CodeQL"

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]
  schedule:
    - cron: '36 8 * * 5'

jobs:
  analyze:
    name: Analyze
    runs-on: ubuntu-24.04
    env:
      CC: gcc-14
      CXX: g++-14

    strategy:
      fail-fast: false

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

    - name: Initialize CodeQL
      uses: github/codeql-action/init@v3
      with:
        languages: cpp

    - name: Create Build Environment
      run: sudo ./tests/ci/install-deps-deb.sh

    - name: Make & Install 3rd-party
      run: sudo ./tests/ci/ci-install-extern.sh

    - name: Build & Test
      run: ./tests/ci/run-build.sh codeql

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