-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (48 loc) · 1.5 KB
/
codeql.yml
File metadata and controls
51 lines (48 loc) · 1.5 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
name: CodeQL
# CodeQL doesn't have first-class Rust support, so this workflow only
# analyzes the BPF C source under src/bpf/ and the GitHub Actions
# workflows. It's a backstop for the small surface of non-Rust code
# in the project; the Rust-side checks live in ci.yml.
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: "0 9 * * 1"
jobs:
analyze:
name: analyze (${{ matrix.language }})
runs-on: ubuntu-24.04
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [c-cpp, actions]
steps:
- uses: actions/checkout@v4
- name: install bpf build deps
if: matrix.language == 'c-cpp'
run: |
sudo apt-get update
sudo apt-get install -y clang libbpf-dev libelf-dev zlib1g-dev linux-libc-dev
- uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
- name: build BPF C
if: matrix.language == 'c-cpp'
run: |
# The BPF program lives in src/bpf/. Compile it directly so
# CodeQL has something to analyze for c-cpp.
mkdir -p target/codeql
clang -target bpf -O2 -g \
-I src/bpf \
-I /usr/include/x86_64-linux-gnu \
-c src/bpf/tracer.bpf.c \
-o target/codeql/tracer.o
- uses: github/codeql-action/analyze@v3
with:
category: "/language:${{ matrix.language }}"