Repository navigation
77 lines (66 loc) · 2.1 KB
/
Copy pathcodeql.yml
File metadata and controls
77 lines (66 loc) · 2.1 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:
- cron: '24 3 * * 1'
permissions:
actions: read
contents: read
security-events: write
jobs:
analyze:
name: CodeQL analyze C++
runs-on: ubuntu-latest
env:
CC: clang
CXX: clang++
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Install dependencies
run: |
sh scripts/ci-apt-update.sh # falls back to public DNS (ADR-0650)
sudo apt-get install -y \
bison \
clang \
catch2 \
flex \
libcurl4-openssl-dev \
libpq-dev \
libsodium-dev \
libssl-dev \
m4 \
perl \
pkg-config
python -m pip install --require-hashes --only-binary :all: --requirement requirements-build.txt
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: c-cpp
queries: security-extended,security-and-quality
build-mode: manual
- name: Build
run: sh scripts/build-linux.sh --builddir build --compile-only
# Analyse without uploading, so the report can be filtered first (ADR-0226).
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
with:
category: '/language:c-cpp'
upload: never
output: codeql-results
# Drops only what the ADRs name, and keeps every other result:
# cpp/unused-static-function under tests/, which cannot follow Catch2's
# SCENARIO registration (ADR-0226); every result under subprojects/ and
# build/, code this project does not write (ADR-0527); and
# cpp/path-injection whose every source is a command-line argument
# (ADR-0528).
- name: Filter excluded results
run: python3 scripts/filter_codeql_sarif.py codeql-results
- name: Upload CodeQL results
uses: github/codeql-action/upload-sarif@v4
with:
sarif_file: codeql-results
category: '/language:c-cpp'