Add some static analysis to the code base. #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |