Skip to content

Add some static analysis to the code base. #2

Add some static analysis to the code base.

Add some static analysis to the code base. #2

name: Run static analysis tools
on:
push:
branches:
- master
pull_request:
jobs:
static-analysis:
runs-on: ubuntu-latest
container:
image: debian:testing
env:
CC: clang
CXX: clang++
strategy:
matrix:
tool:
- { packages: "clang-tidy", command: "clang-tidy -p build/ app/*.cc modules/*.cc util/*.cc" }
- { packages: "cppcheck", command: "cppcheck --check-level=exhaustive --addon=threadsafety -D__unix__ -D__GNUC__ --project=build/compile_commands.json -i subprojects/" }
steps:
- name: Install dependencies
run: apt update && apt install -y git meson clang ${{ matrix.tool.packages }}
- uses: actions/checkout@v4
with:
submodules: true
- name: Generate compile_commands.json
run: meson setup --buildtype release --werror -Dpcie_opt=true build || cat build/meson-logs/meson-log.txt /nonexistent
- name: Run static analysis tool
run: ${{ matrix.tool.command }}