forked from cda-tum/mqt-core
-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (73 loc) · 2.06 KB
/
reusable-code-ql-cpp.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: 📝 • CodeQL • C++
on:
workflow_call:
inputs:
cmake-args:
description: "Additional arguments to pass to CMake"
default: ""
type: string
setup-z3:
description: "Whether to set up Z3"
default: false
type: boolean
z3-version:
description: "The version of Z3 to set up"
default: "4.11.2"
type: string
jobs:
analyze:
name: 🇨 Analysis
runs-on: ubuntu-latest
permissions:
security-events: write
env:
CMAKE_BUILD_PARALLEL_LEVEL: 3
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- if: ${{ inputs.setup-z3 }}
name: Setup Z3
uses: cda-tum/setup-z3@v1
with:
version: ${{ inputs.z3-version }}
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Setup ccache
uses: Chocobo1/setup-ccache-action@v1
with:
prepend_symlinks_to_path: false
override_cache_key: codeql-cpp
- name: Set up mold as linker
uses: rui314/setup-mold@v1
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: cpp
setup-python-dependencies: false
config: |
queries:
- uses: security-and-quality
- name: Configure CMake
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug ${{ inputs.cmake-args }}
- name: Build
run: cmake --build build
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
upload: False
output: sarif-results
- name: filter-sarif
uses: advanced-security/filter-sarif@main
with:
patterns: |
-**/extern/**
-**/build/**
input: sarif-results/cpp.sarif
output: sarif-results/cpp.sarif
- name: Upload SARIF
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: sarif-results/cpp.sarif