Skip to content

Commit 5393ddf

Browse files
ci: add CodeQL static analysis
- New codeql.yml with manual build mode for C/C++ analysis - Uses security-extended query suite, triggers on push/PR to master plus weekly schedule - Upgraded to CodeQL Action v4 with full SHA pins - Permissions scoped to contents: read and security-events: write - Pin runner to ubuntu-24.04, add setup-python for PEP 668 compatibility, add job timeout
1 parent 25b58aa commit 5393ddf

1 file changed

Lines changed: 51 additions & 0 deletions

File tree

.github/workflows/codeql.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: CodeQL
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
workflow_dispatch:
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
12+
cancel-in-progress: true
13+
14+
permissions:
15+
contents: read
16+
security-events: write
17+
18+
jobs:
19+
analyze:
20+
name: Analyze C
21+
runs-on: ubuntu-24.04
22+
timeout-minutes: 30
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
26+
27+
- name: Set up Python
28+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
29+
with:
30+
python-version: '3.12'
31+
32+
- name: Initialize CodeQL
33+
uses: github/codeql-action/init@bc0b696b4103f5fe60f15749af68a046868d511a # codeql-bundle-v2.25.4
34+
with:
35+
languages: c-cpp
36+
build-mode: manual
37+
queries: security-extended
38+
39+
- name: Install dependencies
40+
run: |
41+
sudo apt-get update
42+
sudo apt-get install -y gcc ninja-build pkg-config libglib2.0-dev libfuse3-dev
43+
pip3 install meson
44+
45+
- name: Build
46+
run: |
47+
meson setup build --buildtype=debug
48+
ninja -C build sshfs
49+
50+
- name: Perform CodeQL Analysis
51+
uses: github/codeql-action/analyze@bc0b696b4103f5fe60f15749af68a046868d511a # codeql-bundle-v2.25.4

0 commit comments

Comments
 (0)