11# Reusable: lint only (cppcheck + clang-format).
2- # Security-static and CodeQL gate are separate — see _security .yml.
2+ # Security-static is separate — see _security.yml; CodeQL — see codeql .yml.
33name : Lint & Security
44
55on :
6- workflow_call : {}
6+ workflow_call :
7+ inputs :
8+ lanes :
9+ description : ' PR lane selection (scripts/ci/select-lanes.sh JSON list); "all" = every job (dry run, release)'
10+ type : string
11+ default : all
712
813permissions :
914 contents : read
1015
1116jobs :
1217 lint :
13- runs-on : ubuntu-latest
18+ if : ${{ inputs.lanes == 'all' || contains(fromJSON(inputs.lanes), 'lint') }}
19+ # Pinned, not ubuntu-latest: the LLVM install below adds an
20+ # apt.llvm.org llvm-toolchain-NOBLE repo, which is 24.04 by name. When
21+ # GitHub moves ubuntu-latest to the next LTS this job breaks on a day
22+ # nobody chose. Pin the runner to the release the repo line already names.
23+ runs-on : ubuntu-24.04
1424 # 15 min proved too tight on a slow runner day and a timed-out lint reads
1525 # as "cancelled", which the release graph must treat as a hard stop; keep
16- # a bound, but one only a genuine hang can hit (normal runtime ~5 min).
17- timeout-minutes : 30
26+ # a bound, but one only a genuine hang can hit. 30 min stopped being that
27+ # in 2026-10: single-process cppcheck over a src tree that grew ~60 % in
28+ # files took the lint step from ~8 to 22-29 min, and three runs on
29+ # 2026-10-13 were cancelled at 30 min with cppcheck still alive.
30+ timeout-minutes : 45
1831 steps :
1932 - uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
2033
@@ -24,14 +37,16 @@ jobs:
2437 run : bash scripts/check-no-test-skips.sh
2538
2639 - name : Install build deps
27- run : sudo apt-get update && sudo apt-get install -y zlib1g-dev cmake
40+ timeout-minutes : 10
41+ run : APT_RETRIES=3; [ -f /etc/apt/apt-mirrors.txt ] && APT_RETRIES=0; sudo apt-get -o Acquire::Retries=$APT_RETRIES -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 --error-on=any update && sudo apt-get -o Acquire::Retries=$APT_RETRIES -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 install -y zlib1g-dev cmake
2842
2943 - name : Install LLVM 20
44+ timeout-minutes : 10
3045 run : |
3146 wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
3247 echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-20 main" | sudo tee /etc/apt/sources.list.d/llvm-20.list
33- sudo apt-get update
34- sudo apt-get install -y clang-format-20
48+ APT_RETRIES=3; [ -f /etc/apt/apt-mirrors.txt ] && APT_RETRIES=0; sudo apt-get -o Acquire::Retries=$APT_RETRIES -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 --error-on=any update
49+ sudo apt-get -o Acquire::Retries=$APT_RETRIES -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 install -y clang-format-20
3550
3651 - uses : actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
3752 id : cppcheck-cache
@@ -60,20 +75,24 @@ jobs:
6075 # provability (never suppressed — the NOLINT ban applies here too).
6176 # Vendored-tree diagnostics are path-filtered, mirroring .cppcheck.
6277 lint-mem :
63- runs-on : ubuntu-latest
78+ if : ${{ inputs.lanes == 'all' || contains(fromJSON(inputs.lanes), 'lint-mem') }}
79+ # Pinned for the same reason as `lint`: llvm-toolchain-noble-21 below.
80+ runs-on : ubuntu-24.04
6481 timeout-minutes : 60
6582 steps :
6683 - uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
6784
6885 - name : Install build deps
69- run : sudo apt-get update && sudo apt-get install -y zlib1g-dev
86+ timeout-minutes : 10
87+ run : APT_RETRIES=3; [ -f /etc/apt/apt-mirrors.txt ] && APT_RETRIES=0; sudo apt-get -o Acquire::Retries=$APT_RETRIES -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 --error-on=any update && sudo apt-get -o Acquire::Retries=$APT_RETRIES -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 install -y zlib1g-dev
7088
7189 - name : Install LLVM 21 (pinned analyzer toolchain)
90+ timeout-minutes : 10
7291 run : |
7392 wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
7493 echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-21 main" | sudo tee /etc/apt/sources.list.d/llvm-21.list
75- sudo apt-get update
76- sudo apt-get install -y clang-tidy-21
94+ APT_RETRIES=3; [ -f /etc/apt/apt-mirrors.txt ] && APT_RETRIES=0; sudo apt-get -o Acquire::Retries=$APT_RETRIES -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 --error-on=any update
95+ sudo apt-get -o Acquire::Retries=$APT_RETRIES -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 install -y clang-tidy-21
7796
7897 - name : Memory-analyzer gate
7998 run : scripts/ci/lint-mem.sh clang-tidy-21
0 commit comments