@@ -553,7 +553,6 @@ jobs:
553553 continue-on-error : false
554554 permissions :
555555 contents : read
556- pull-requests : write
557556
558557 steps :
559558 - name : Checkout (with submodules)
@@ -568,8 +567,28 @@ jobs:
568567 sudo apt-get update
569568 sudo apt-get install -y \
570569 build-essential cmake ninja-build pkg-config \
571- llvm-dev libclang-dev clang clang-tidy \
572- libssl-dev
570+ llvm-dev libclang-dev clang \
571+ libssl-dev wget ca-certificates gnupg
572+
573+ - name : Install clang-tidy 19 (for ExcludeHeaderFilterRegex support)
574+ run : |
575+ set -eux
576+ # Ubuntu 24.04 apt ships clang-tidy 18, which doesn't understand
577+ # ExcludeHeaderFilterRegex (added in 19). Pull clang-tidy 19 from
578+ # the upstream LLVM apt repository and pin the unversioned names.
579+ sudo install -m 0755 -d /etc/apt/keyrings
580+ wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key \
581+ | sudo tee /etc/apt/keyrings/llvm.asc >/dev/null
582+ sudo chmod a+r /etc/apt/keyrings/llvm.asc
583+ codename=$(lsb_release -cs)
584+ echo "deb [signed-by=/etc/apt/keyrings/llvm.asc] http://apt.llvm.org/${codename}/ llvm-toolchain-${codename}-19 main" \
585+ | sudo tee /etc/apt/sources.list.d/llvm-19.list >/dev/null
586+ sudo apt-get update
587+ sudo apt-get install -y clang-tidy-19 clang-tools-19
588+ sudo ln -sf /usr/bin/clang-tidy-19 /usr/local/bin/clang-tidy
589+ sudo ln -sf /usr/bin/run-clang-tidy-19 /usr/local/bin/run-clang-tidy
590+ clang-tidy --version
591+ run-clang-tidy --help | head -1 || true
573592
574593 - name : Install Rust (stable)
575594 uses : dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9
@@ -590,33 +609,9 @@ jobs:
590609 run : cmake --build build-release --target livekit_proto
591610
592611 - name : Run clang-tidy
593- uses : cpp-linter/cpp-linter-action@77c390c5ba9c947ebc185a3e49cc754f1558abb5 # v2.18.0
594- id : linter
595612 env :
596- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
597- with :
598- style : ' '
599- tidy-checks : ' '
600- database : build-release
601- files-changed-only : false
602- lines-changed-only : true
603- extensions : ' c,cpp,cc,cxx'
604- ignore : ' build-*|cpp-example-collection|client-sdk-rust|vcpkg_installed|src/tests|bridge|src/room_event_converter.cpp'
605- file-annotations : true
606- thread-comments : false
607- step-summary : true
608- tidy-review : false
609- no-lgtm : true
610- jobs : 0 # 0 == use all available CPU cores
611-
612- - name : Check warning thresholds
613- env :
614- TIDY_FINDINGS : ${{ steps.linter.outputs.clang-tidy-checks-failed }}
615- MAX_TIDY_FINDINGS : ' 0'
616- run : |
617- echo "clang-tidy findings: ${TIDY_FINDINGS}"
618- if [ "${TIDY_FINDINGS}" -gt "${MAX_TIDY_FINDINGS}" ]; then
619- echo "::warning::clang-tidy found ${TIDY_FINDINGS} issue(s), threshold is ${MAX_TIDY_FINDINGS}"
620- exit 1
621- fi
622- echo "clang-tidy findings within threshold"
613+ TIDY_BLOB_SHA : ${{ github.event.pull_request.head.sha || github.sha }}
614+ # This script is intended to be run locally and in CI. It will auto-detect
615+ # the GHA environment and add PR annotations and a run summary.
616+ # As of writing all warnings are treateded as errors to avoid tech debt build up
617+ run : ./scripts/clang-tidy.sh --fail-on-warning
0 commit comments