name: "CodeQL"

on:
  push:
    branches: [ "master", "release-*" ]
  pull_request:
    branches: [ "master", "release-*" ]
  schedule:
    - cron: '45 16 * * 3'

jobs:
  code-ql:
    name: Analyze
    runs-on: 'ubuntu-latest'
    timeout-minutes: 360
    permissions:
      security-events: write

    strategy:
      fail-fast: false
      matrix:
        language:
#          - 'c-cpp' # Tested as part of the linux builds
          - 'python'
          - 'ruby'

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

    - name: Initialize CodeQL
      uses: github/codeql-action/init@v3
      with:
        languages: ${{ matrix.language }}

    - name: Autobuild
      uses: github/codeql-action/autobuild@v3

    - name: Perform CodeQL Analysis
      uses: github/codeql-action/analyze@v3
      with:
        category: "/language:${{matrix.language}}"
