Skip to content

release: squash feature/config-extensions for v0.5.0 (#9) #137

release: squash feature/config-extensions for v0.5.0 (#9)

release: squash feature/config-extensions for v0.5.0 (#9) #137

name: Static Analysis
on:
push:
branches: ["**"]
pull_request:
branches: [main]
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
clang-tidy:
name: clang-tidy
runs-on: ubuntu-latest
container: mcr.microsoft.com/devcontainers/cpp:ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Install clang-tidy
run: apt-get update -qq && apt-get install -y --no-install-recommends clang-tidy
- name: Configure (with compile_commands.json)
run: |
cmake -B .vscode/build -S . \
-G Ninja \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-Wno-dev
- name: Run clang-tidy
run: |
# Derive the lint set from compile_commands.json so any host-built
# .cpp gets linted automatically (TASK-348). Excludes third-party
# (_deps/, googletest, arduinojson) and the test harness (/test/) —
# headers are linted transitively through their includer.
python3 -c "
import json, re
excluded = re.compile(r'_deps/|/test/|arduinojson|googletest')
files = sorted({e['file'] for e in json.load(open('.vscode/build/compile_commands.json'))
if not excluded.search(e['file'])})
print('\n'.join(files))
" | xargs clang-tidy -p .vscode/build
platformio-ini:
name: platformio.ini lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install PlatformIO
run: pip install --quiet platformio
- name: Lint platformio.ini
# scripts/validate_platformio_ini.py wraps `pio project config` and
# `pio project config --lint` so unknown keys (typos like `boord`)
# are promoted to errors. Static — no toolchain install, no build.
run: python scripts/validate_platformio_ini.py