CodeQL Analysis #20
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "CodeQL Analysis" | |
on: | |
push: | |
branches: main | |
pull_request: | |
branches: main | |
schedule: | |
- cron: "0 12 * * 1" # Run every Monday at 12:00 UTC | |
workflow_dispatch: | |
jobs: | |
analyze: | |
name: Analyze | |
runs-on: ubuntu-${{ vars.UBUNTU_VERSION }} | |
permissions: | |
actions: read | |
contents: read | |
security-events: write | |
strategy: | |
fail-fast: false | |
matrix: | |
language: ["cpp"] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Initialize CodeQL | |
uses: github/codeql-action/init@v2 | |
with: | |
languages: ${{ matrix.language }} | |
queries: security-and-quality | |
- name: Install dependencies | |
run: | | |
sudo apt update | |
sudo apt install -y build-essential cmake libboost-all-dev | |
- name: Configure build | |
run: | | |
mkdir -p build | |
cd build | |
cmake -DCMAKE_BUILD_TYPE=Debug .. | |
- name: Build | |
run: | | |
cd build | |
cmake --build . --config Debug | |
- name: Perform CodeQL Analysis | |
uses: github/codeql-action/analyze@v2 | |
with: | |
category: "/language:${{ matrix.language }}" | |
- name: Upload SARIF file | |
uses: github/codeql-action/upload-sarif@v2 | |
with: | |
sarif_file: results/cpp-results.sarif | |
continue-on-error: true |