name: "CodeQL"

on:
  push:
    branches: [main]
  pull_request:
    # The branches below must be a subset of the branches above
    branches: [main]

jobs:
  CodeQL-Build:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout repository
      uses: actions/checkout@v3
      with:
         submodules: 'recursive'
    - name: Remove Third_party Modules from Code Scan
      run: |
        rm -rf third_party
    - name: Setup
      run: |
        sudo ./ci/setup_cmake.sh
        sudo ./ci/setup_ci_environment.sh
    - name: Initialize CodeQL
      uses: github/codeql-action/init@v2
      with:
       languages: cpp
    - name: Autobuild
      uses: github/codeql-action/autobuild@v2
    - name: Perform CodeQL Analysis
      uses: github/codeql-action/analyze@v2
