Skip to content

Issue #10: Test code style check DO NOT MERGE #11

Issue #10: Test code style check DO NOT MERGE

Issue #10: Test code style check DO NOT MERGE #11

name: C++ Code Style and Static Analysis
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
jobs:
check-cs:
runs-on: ubuntu-latest
permissions:
contents: read
checks: write
packages: read
container: ghcr.io/kpi-rover/kpi-rover-bbb-check:latest
steps:
- name: Checkout Code with Submodules
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- name: Configure CMake
run: cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -B build/check
- name: Verify compile_commands.json exists
run: ls build/check/compile_commands.json
- name: Run Clang-Format
id: clang-format
run: find src/kpi_rover_ecu/ -name '*.cpp' -o -name '*.h' | xargs --no-run-if-empty clang-format --dry-run --Werror
- name: Run Clang-Tidy
id: clang-tidy
run: find src/kpi_rover_ecu/ -name '*.cpp' -o -name '*.h' | xargs --no-run-if-empty clang-tidy -p=build/check --warnings-as-errors='*'