Skip to content

Commit f2f8b79

Browse files
ci: add CodeQL workflow for C/C++ analysis (#243) (#315)
* ci: add CodeQL analysis workflow (#243) * ci: add CodeQL analysis workflow (#243)
1 parent 6239975 commit f2f8b79

1 file changed

Lines changed: 50 additions & 0 deletions

File tree

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: CodeQL
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
permissions:
8+
contents: read
9+
security-events: write
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
13+
cancel-in-progress: true
14+
15+
env:
16+
# Match .github/workflows/build.yml (plain Release; no LSan — avoids sanitizer/CodeQL interaction)
17+
BUILD_TYPE: Release
18+
19+
jobs:
20+
analyze:
21+
name: Analyze (cpp)
22+
runs-on: ubuntu-latest
23+
timeout-minutes: 120
24+
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@v4
28+
29+
- name: Initialize CodeQL
30+
uses: github/codeql-action/init@v4
31+
with:
32+
languages: cpp
33+
build-mode: manual
34+
config: |
35+
paths-ignore:
36+
- libCacheSim-node
37+
38+
- name: Install build dependencies
39+
run: bash scripts/install_dependency.sh
40+
41+
- name: Configure CMake
42+
run: cmake -G Ninja -B "${{ github.workspace }}/build" -DCMAKE_BUILD_TYPE="${{ env.BUILD_TYPE }}"
43+
44+
- name: Build
45+
run: ninja -C "${{ github.workspace }}/build"
46+
47+
- name: Perform CodeQL Analysis
48+
uses: github/codeql-action/analyze@v4
49+
with:
50+
category: "/language:cpp"

0 commit comments

Comments
 (0)