-
Notifications
You must be signed in to change notification settings - Fork 0
173 lines (149 loc) · 5.41 KB
/
codeql.yml
File metadata and controls
173 lines (149 loc) · 5.41 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
name: "CodeQL Advanced"
on:
schedule:
- cron: '0 0 1 * *'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
permissions:
security-events: write
packages: read
actions: read
contents: read
defaults:
run:
shell: bash
jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-24.04
timeout-minutes: 120
strategy:
fail-fast: false
matrix:
include:
- language: c-cpp
build-mode: manual
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install Qt 6.11.0
if: matrix.language == 'c-cpp'
uses: jurplel/install-qt-action@v4
with:
version: '6.11.0'
target: desktop
arch: linux_gcc_64
modules: >-
qt5compat qt3d qtcharts qtconnectivity qtgraphs qtgrpc
qthttpserver qtimageformats qtlottie qtmultimedia
qtnetworkauth qtpositioning qtquick3d qtquick3dphysics
qtquicktimeline qtremoteobjects qtscxml qtsensors
qtserialbus qtserialport qtshadertools qtspeech
qtvirtualkeyboard qtwebchannel qtwebsockets qtwebview
qtlocation
cache: true
setup-python: true
install-deps: true
- name: Export Qt environment
if: matrix.language == 'c-cpp'
run: |
set -euo pipefail
test -d "${QT_ROOT_DIR}"
qt6_dir="${QT_ROOT_DIR}/lib/cmake/Qt6"
test -f "${qt6_dir}/Qt6Config.cmake"
echo "QT_DIR=${QT_ROOT_DIR}" >> "${GITHUB_ENV}"
echo "Qt6_DIR=${qt6_dir}" >> "${GITHUB_ENV}"
echo "QT_DIR=${QT_ROOT_DIR}"
echo "Qt6_DIR=${qt6_dir}"
- name: Verify hosted native tools
if: matrix.language == 'c-cpp'
run: |
clang --version | head -n 1
clang++ --version | head -n 1
wget --version | head -n 1
unzip -v | head -n 1
- name: Install CMake 4.2.3
if: matrix.language == 'c-cpp'
run: |
cmake_url='https://github.com/Kitware/CMake/releases/download/v4.2.3/cmake-4.2.3-linux-x86_64.tar.gz'
cmake_sha256='5bb505d5e0cca0480a330f7f27ccf52c2b8b5214c5bba97df08899f5ef650c23'
cmake_archive="${RUNNER_TEMP}/cmake.tar.gz"
cmake_root="${RUNNER_TEMP}/cmake"
wget -qO "${cmake_archive}" "${cmake_url}"
echo "${cmake_sha256} ${cmake_archive}" | sha256sum --check --status
mkdir -p "${cmake_root}"
tar -xzf "${cmake_archive}" -C "${cmake_root}" --strip-components=1
echo "${cmake_root}/bin" >> "${GITHUB_PATH}"
- name: Install FASTBuild
if: matrix.language == 'c-cpp'
run: |
fastbuild_url='https://fastbuild.org/downloads/v1.19/FASTBuild-Linux-x64-v1.19.zip'
fastbuild_sha256='8d07bcf7e6840409ee96105caf93093a3a5efc6271a635cbb4e91021472e95a7'
fastbuild_archive="${RUNNER_TEMP}/fastbuild.zip"
fastbuild_root="${RUNNER_TEMP}/fastbuild"
wget -qO "${fastbuild_archive}" "${fastbuild_url}"
echo "${fastbuild_sha256} ${fastbuild_archive}" | sha256sum --check --status
mkdir -p "${fastbuild_root}"
unzip -q "${fastbuild_archive}" -d "${fastbuild_root}"
chmod +x "${fastbuild_root}/fbuild" "${fastbuild_root}/fbuildworker"
ln -sf "${fastbuild_root}/fbuild" "${fastbuild_root}/FBuild"
echo "${fastbuild_root}" >> "${GITHUB_PATH}"
- name: Resolve FASTBuild cache path
if: matrix.language == 'c-cpp'
id: fbcache
run: |
sudo mkdir -p /cache/fastbuild
sudo chown "$USER":"$USER" /cache/fastbuild
echo "path=/cache/fastbuild" >> "${GITHUB_OUTPUT}"
- name: Restore FASTBuild compilation cache
if: matrix.language == 'c-cpp'
uses: actions/cache@v5
with:
path: ${{ steps.fbcache.outputs.path }}
key: fbcache-codeql-linux-${{ github.sha }}
restore-keys: fbcache-codeql-linux-
- name: Verify tool versions
if: matrix.language == 'c-cpp'
run: |
echo "CMake: $(cmake --version | head -n 1)"
echo "Clang: $(clang++ --version | head -n 1)"
echo "FASTBuild: $(FBuild -version | head -n 1)"
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
queries: security-and-quality
config: |
paths:
- src
paths-ignore:
- build
- '**/bin/**'
- '**/obj/**'
- name: Configure native build
if: matrix.language == 'c-cpp'
env:
CC: clang
CXX: clang++
run: cmake --preset linux-ci
- name: Build native code
if: matrix.language == 'c-cpp'
env:
CC: clang
CXX: clang++
run: cmake --build --preset linux-ci
- name: Trim FASTBuild cache
if: always() && matrix.language == 'c-cpp'
run: |
if [[ -d "${GITHUB_WORKSPACE}/build/linux-ci" ]]; then
(
cd "${GITHUB_WORKSPACE}/build/linux-ci"
FBuild -cachetrim 10240
)
fi
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
with:
category: "/language:${{ matrix.language }}"