Skip to content

CodeQL

CodeQL #208

Workflow file for this run

name: "CodeQL"
on:
schedule:
- cron: '20 19 * * 1,5'
permissions: read-all
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
analyze:
name: Analyze
runs-on: ubuntu-22.04
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'cpp', 'python' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: '0'
- name: Install dependencies
if: ${{ matrix.language == 'cpp' }}
run: |
sudo apt update && \
sudo apt install --yes --no-install-recommends \
build-essential \
cmake \
ccache \
libboost-dev \
libcapstone-dev \
libgrpc++-dev \
libssh2-1-dev \
vulkan-validationlayers-dev \
libz-dev \
llvm-dev \
protobuf-compiler-grpc \
pkg-config \
libvulkan-volk-dev \
libvulkan-dev \
libopengl-dev \
libglx-dev \
mesa-common-dev \
qtbase5-dev \
libgtest-dev \
libgmock-dev \
git \
libprotobuf-dev
- name: Save CCache Timestamp
if: ${{ matrix.language == 'cpp' }}
id: ccache_timestamp
run: echo "timestamp=$(date +%m-%d-%Y--%H:%M:%S)" >> $GITHUB_OUTPUT
- name: Setup CCache Files
if: ${{ matrix.language == 'cpp' }}
uses: actions/cache@v3
with:
path: .ccache
key: CodeQL-ccache-${{ steps.ccache_timestamp.outputs.timestamp }}
restore-keys: |
CodeQL-ccache-
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
- run: mkdir build
if: ${{ matrix.language == 'cpp' }}
- name: CMake Configure
if: ${{ matrix.language == 'cpp' }}
working-directory: ./build
env:
CXX: g++
CC: gcc
run: |
cmake -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_FLAGS="-march=sandybridge -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer" \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
${GITHUB_WORKSPACE}
- run: ccache -p
if: ${{ matrix.language == 'cpp' }}
- run: ccache -z
if: ${{ matrix.language == 'cpp' }}
- name: CMake Build
if: ${{ matrix.language == 'cpp' }}
working-directory: ./build
run: cmake --build .
- name: CCache Stats
if: ${{ matrix.language == 'cpp' }}
run: ccache -s
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"