Skip to content

Commit 4807d79

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 88692b7 commit 4807d79

2 files changed

Lines changed: 55 additions & 2 deletions

File tree

.github/workflows/build-ubuntu.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ jobs:
6161
run: |
6262
mkdir -p ~/.ssh
6363
chmod 700 ~/.ssh
64-
ssh-keygen -b 2048 -t rsa -f ~/.ssh/id_rsa -q -N ""
65-
cat ~/.ssh/id_rsa.pub > ~/.ssh/authorized_keys
64+
ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519 -q -N ""
65+
cat ~/.ssh/id_ed25519.pub > ~/.ssh/authorized_keys
6666
chmod 600 ~/.ssh/authorized_keys
6767
sudo systemctl start ssh || sudo service ssh start
6868
ssh -o StrictHostKeyChecking=no -o BatchMode=yes localhost true

.github/workflows/codeql.yml

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

0 commit comments

Comments
 (0)