-
Notifications
You must be signed in to change notification settings - Fork 203
84 lines (69 loc) · 2.4 KB
/
codeql.yml
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
78
79
80
81
82
83
84
# SPDX-FileCopyrightText: 2024 Emil Velikov <emil.l.velikov@gmail.com>
# SPDX-FileCopyrightText: 2024 Lucas De Marchi <lucas.de.marchi@gmail.com>
#
# SPDX-License-Identifier: LGPL-2.1-or-later
name: CodeQL
on:
push:
branches: [master, ci-test]
pull_request:
branches: [master]
schedule:
- cron: "30 2 * * 0"
permissions:
contents: read
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
security-events: write
strategy:
fail-fast: false
matrix:
include:
- container: 'ubuntu:24.04'
container:
image: ${{ matrix.container }}
steps:
- name: Sparse checkout the local actions
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
sparse-checkout: .github
- uses: ./.github/actions/setup-ubuntu
if: ${{ startsWith(matrix.container, 'ubuntu') }}
- name: Checkout the whole project
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set the environment
run: |
# The second checkout above claims to set safe.directory, yet it
# doesn't quite work. Perhaps our double/sparse checkout is to blame?
git config --global --add safe.directory '*'
- name: Initialize CodeQL
uses: github/codeql-action/init@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0
with:
languages: cpp
queries: +security-and-quality
- name: Build
run: |
meson setup --native-file build-dev.ini build
meson compile -C build
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0
with:
category: "/language:cpp"
upload: false
output: sarif-results
- name: Filter out meson-internal test files
uses: advanced-security/filter-sarif@f3b8118a9349d88f7b1c0c488476411145b6270d # v1.0.1
with:
patterns: |
-build/meson-private/**/testfile.c
input: sarif-results/cpp.sarif
output: sarif-results/cpp.sarif
- name: Upload CodeQL results to code scanning
uses: github/codeql-action/upload-sarif@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0
with:
sarif_file: sarif-results/cpp.sarif
category: "/language:cpp"