-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (68 loc) · 2.35 KB
/
codeql.yml
File metadata and controls
77 lines (68 loc) · 2.35 KB
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
75
76
77
name: CodeQL
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
# Off-peak weekly run — catches advisories that landed in the
# query database between pushes.
- cron: "17 4 * * 0"
# Cancel an in-flight CodeQL run if a newer commit lands on the same
# ref — saves runner time without losing the latest result.
concurrency:
group: codeql-${{ github.ref }}
cancel-in-progress: true
jobs:
analyze:
name: CodeQL Analysis
runs-on: ubuntu-24.04
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [c-cpp]
steps:
- uses: actions/checkout@v6
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
# `security-and-quality` is broader than the default
# `security` suite — picks up dataflow + maintainability
# checks alongside vuln patterns.
queries: security-and-quality
# Path filtering lives in a separate file: the inline
# `config:` form attempted in PR #2 silently failed to
# apply (90 grammar alerts re-fired on the merge commit).
# See .github/codeql/codeql-config.yml for the rationale.
config-file: ./.github/codeql/codeql-config.yml
# Mirrors `ci.yml`'s apt list — keep them in sync so CodeQL
# builds with the same dependency surface as the regular CI.
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
cmake ninja-build \
git pkg-config \
libsqlite3-dev \
libspdlog-dev \
libfmt-dev \
nlohmann-json3-dev \
libtomlplusplus-dev \
libgtest-dev
- name: Build
# Explicit build (rather than `autobuild`) so any CodeQL
# failure mode is "the same thing ci.yml does, plus one of
# CodeQL's checks tripped" — not a mystery autobuild bug.
run: |
cmake -B build -S . -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build build --parallel
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
with:
category: "/language:${{ matrix.language }}"