Skip to content

Add static analysis workflow #445

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 30 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
36a2127
video player: use square BO
ardera Feb 21, 2025
0b3f3a4
video player: use playbin3 instead of uridecodebin
ardera Feb 21, 2025
2298020
video player: don't handle dma_drm video info
ardera Feb 21, 2025
ca1eee4
video player: fix code for gstreamer < 1.24.0
ardera Feb 21, 2025
58663ba
video player: fix parameter in g_object_set
ardera Feb 21, 2025
dc0ff2a
video player: disable hw decoding for gstreamer < 1.22.8
ardera May 8, 2025
ef858c0
video player: make seek flags construction a bit more easier to follow
ardera May 8, 2025
878f39c
util: add khash hashmap implementation
ardera May 8, 2025
0e6b1da
platform channels: helpers for decoding method calls
ardera May 12, 2025
5f65e73
gitignore: ignore .cache
ardera May 12, 2025
63de32b
gstplayer: feature parity with audioplayers player
ardera May 12, 2025
2f37727
audioplayers: migrate to gstplayer
ardera May 9, 2025
0740253
gstplayer: move gstplayer into separate file
ardera May 12, 2025
efab797
modesetting: remove logs if a separate cursor plane couldn't be found
ardera May 12, 2025
436f790
cmake: remove deleted `audioplayers/player.c` file
ardera May 12, 2025
c7a7493
Revert "video player: disable hw decoding for gstreamer < 1.22.8"
ardera May 13, 2025
815ac82
gstplayer: don't use gst_video_info_new_from_caps
ardera May 13, 2025
facc7fc
gstplayer: only define appsink event handler for gstreamer >= 1.20.0
ardera May 13, 2025
5e72346
gstplayer: don't use sd_event_source_disable_unref
ardera May 13, 2025
cd2c8ef
notifier/listener: fix change notifiers notifying on listen
ardera May 16, 2025
1584c59
gstplayer/audio player/video player: various compatibility fixes
ardera May 16, 2025
c2ed358
flutter-pi: allow getting tracer of flutterpi instance
ardera May 16, 2025
d008074
video player: Better feedback when trying to create pipeline video
ardera May 19, 2025
3a95567
gstplayer: re-implement creating video players from pipeline description
ardera Jun 2, 2025
4d29038
style: make bool flag arguments more readable
ardera Jun 2, 2025
98215b1
gstplayer, video player: add tracing
ardera Jun 7, 2025
561eb37
ci: add CodeChecker static analysis workflow
ardera Jun 21, 2025
9617e92
fix: lots of CodeChecker warnings
ardera Jun 21, 2025
fd485d6
fix: more clang-tidy and clangsa warnings
ardera Jun 25, 2025
7d32aeb
fix: update apt cache before installing static analysis dependencies
ardera Jun 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .codechecker.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"analyze": [
"-d",
"clang-diagnostic-reserved-macro-identifier",
"-d",
"clang-diagnostic-reserved-identifier",
"-d",
"cert-err33-c",
"-d",
"clang-diagnostic-sign-compare",
"-d",
"clang-diagnostic-implicit-int-float-conversion",
"-d",
"clang-diagnostic-switch-enum",
"--analyzers",
"clangsa",
"clang-tidy",
"gcc",
"-i",
".codechecker.skipfile"
]
}
2 changes: 2 additions & 0 deletions .codechecker.skipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
+*/flutter-pi/src
-*
26 changes: 22 additions & 4 deletions .github/workflows/codeql-buildscript.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
#!/usr/bin/env bash

sudo apt install -y cmake libgl1-mesa-dev libgles2-mesa-dev libegl1-mesa-dev libdrm-dev libgbm-dev ttf-mscorefonts-installer fontconfig libsystemd-dev libinput-dev libudev-dev libxkbcommon-dev
mkdir build && cd build
cmake ..
make -j`nproc`
# gstreamer and libc++ want different versions of libunwind-dev.
# We explicitly install the version that gstreamer wants so
# we don't get install errors.

sudo apt-get update
sudo apt-get install -y --no-install-recommends \
git cmake pkg-config ninja-build clang clang-tools \
libgl-dev libgles-dev libegl-dev libvulkan-dev libdrm-dev libgbm-dev libsystemd-dev libinput-dev libudev-dev libxkbcommon-dev \
libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \
libunwind-dev

$WRAPPER cmake \
-S . -B build \
-GNinja \
-DCMAKE_BUILD_TYPE=Debug \
-DBUILD_GSTREAMER_VIDEO_PLAYER_PLUGIN=ON \
-DBUILD_GSTREAMER_AUDIO_PLAYER_PLUGIN=ON \
-DENABLE_VULKAN=ON \
-DENABLE_SESSION_SWITCHING=ON \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON

$WRAPPER cmake --build build
122 changes: 0 additions & 122 deletions .github/workflows/codeql.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,18 @@ def codeql_sarif_contain_error(filename):
rule_index = res['rule']['index']
else:
continue

try:
rule_level = rules_metadata[rule_index]['defaultConfiguration']['level']
except IndexError as e:
print(e, rule_index, len(rules_metadata))
else:
if rule_level == 'error':
return True
except LookupError:
# According to the SARIF schema (https://www.schemastore.org/schemas/json/sarif-2.1.0-rtm.6.json),
# the defalt level is "warning" if not specified.
rule_level = 'warning'

if rule_level == 'error':
return True
elif rule_level == 'warning':
return True
return False

if __name__ == "__main__":
Expand Down
58 changes: 58 additions & 0 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: "Static Analysis"

on:
push:
branches: [ "main", "master" ]
schedule:
- cron: '0 0 * * *'
pull_request:
branches: '*'

jobs:
codechecker:
name: CodeChecker

# Use latest Ubuntu 24.04 for latest GCC.
# CodeChecker requires gcc >= 13.0.0.
# ubuntu-latest is ubuntu 22.04 (atm)
runs-on: ubuntu-24.04

permissions:
actions: read
contents: read
security-events: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install Deps, Configure and Build
run: |
./.github/workflows/codeql-buildscript.sh

- name: Run CodeChecker
uses: ardera/CodeChecker-Action@master
id: codechecker
with:
ctu: true
logfile: ${{ github.workspace }}/build/compile_commands.json
config: ${{ github.workspace }}/.codechecker.json

- uses: actions/upload-artifact@v4
id: upload
with:
name: "CodeChecker Bug Reports"
path: ${{ steps.codechecker.outputs.result-html-dir }}

- name: Fail on Warnings
if: ${{ steps.codechecker.outputs.warnings == 'true' }}
run: |
cat <<EOF >>$GITHUB_STEP_SUMMARY
## ⚠️ CodeChecker found warnings
Please see the 'CodeChecker Bug Reports' artifact for more details:
- ${{ steps.upload.outputs.artifact-url }}
EOF

exit 1
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/.vscode
/build
/out
/.codechecker

# CMake docs says it should not be checked in.
CMakeUserPresets.json
Expand Down Expand Up @@ -99,3 +100,6 @@ Icon
Network Trash Folder
Temporary Items
.apdisk

# Used by zed to store clangd cache
.cache
Loading
Loading