Skip to content

Commit 16b5081

Browse files
committed
CI: Add job to run the Clang analyzer
1 parent dc8ee69 commit 16b5081

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

.github/workflows/build.yml

+45
Original file line numberDiff line numberDiff line change
@@ -132,3 +132,48 @@ jobs:
132132
- name: Meson - Build
133133
run: |
134134
ninja -C _build
135+
analyze:
136+
runs-on: ubuntu-20.04
137+
steps:
138+
- name: Checkout
139+
uses: actions/checkout@v3
140+
- name: Install Dependencies
141+
run: |
142+
curl -sL https://apt.llvm.org/llvm-snapshot.gpg.key | \
143+
sudo apt-key add -
144+
sudo add-apt-repository \
145+
'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-14 main'
146+
sudo apt update
147+
sudo apt install -y flex libjson-glib-dev libxkbcommon-dev \
148+
libegl1-mesa-dev libxml2-dev libxslt1-dev libyaml-dev llvm-14-dev \
149+
libclang-14-dev libglib2.0-dev ninja-build clang-tools-14
150+
- name: Setup Python
151+
uses: actions/setup-python@v4
152+
with:
153+
python-version: '3.6'
154+
- name: Python Package Cache
155+
uses: actions/cache@v3
156+
with:
157+
path: ~/.cache/pip
158+
key: ${{ runner.os }}-pip-${{ hashFiles('.github/workflows/ci.yml') }}
159+
restore-keys: ${{ runner.os }}-pip-
160+
- name: Install Python Packages
161+
run: |
162+
python -m pip install --upgrade pip setuptools wheel
163+
pip install scan-build meson==0.55
164+
- name: Configure
165+
run: |
166+
meson _work --prefix /usr -Dbuild-docs=false
167+
- name: Analyze
168+
run: |
169+
analyze-build \
170+
--enable-checker nullability.NullablePassedToNonnull \
171+
--enable-checker optin.cplusplus.UninitializedObject \
172+
--enable-checker optin.cplusplus.VirtualCall \
173+
--enable-checker optin.performance.Padding \
174+
--enable-checker optin.portability.UnixAPI \
175+
--enable-checker valist.CopyToSelf \
176+
--enable-checker valist.Uninitialized \
177+
--enable-checker valist.Unterminated \
178+
--cdb _work/compile_commands.json \
179+
-o _work/report

0 commit comments

Comments
 (0)