Skip to content

Commit 0d1ca06

Browse files
committed
code-ql: Add step for CPP
Signed-off-by: Tam Mach <[email protected]>
1 parent 4859cc2 commit 0d1ca06

File tree

1 file changed

+48
-2
lines changed

1 file changed

+48
-2
lines changed

.github/workflows/codeql.yml

+48-2
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@ name: CodeQL
33
on:
44
workflow_dispatch:
55

6-
76
jobs:
87
analyze:
98
name: Analyze
10-
runs-on: ubuntu-24.04
9+
runs-on: ubuntu-22.04
1110
permissions:
1211
actions: read
1312
contents: read
@@ -29,3 +28,50 @@ jobs:
2928
uses: github/codeql-action/analyze@v3
3029
with:
3130
category: '/language:${{matrix.language}}'
31+
32+
analyze-cpp:
33+
name: Analyze
34+
runs-on: ubuntu-latest-64-cores-256gb
35+
permissions:
36+
actions: read
37+
contents: read
38+
security-events: write
39+
steps:
40+
- name: Checkout repository
41+
uses: actions/checkout@v4
42+
43+
- name: Initialize CodeQL
44+
uses: github/codeql-action/init@v3
45+
with:
46+
languages: 'cpp'
47+
48+
- name: Install deps (for C++)
49+
shell: bash
50+
run: |
51+
sudo apt-get update --error-on=any
52+
sudo apt-get install --yes \
53+
libtool cmake automake autoconf make ninja-build curl unzip \
54+
virtualenv openjdk-11-jdk build-essential libc++1
55+
mkdir -p bin/clang17
56+
cd bin/clang17
57+
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-17.0.6/clang+llvm-17.0.6-x86_64-linux-gnu-ubuntu-22.04.tar.xz
58+
tar -xf clang+llvm-17.0.6-x86_64-linux-gnu-ubuntu-22.04.tar.xz --strip-components 1
59+
60+
- name: Build (for C++)
61+
run: |
62+
bazel/setup_clang.sh bin/clang17
63+
bazelisk shutdown
64+
bazel build \
65+
-c fastbuild \
66+
--spawn_strategy=local \
67+
--discard_analysis_cache \
68+
--nouse_action_cache \
69+
--features="-layering_check" \
70+
--config=clang-libc++ \
71+
--config=ci \
72+
//cilium/...
73+
74+
- name: Perform CodeQL Analysis
75+
uses: github/codeql-action/analyze@v3
76+
with:
77+
category: '/language:cpp'

0 commit comments

Comments
 (0)