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 :
18+ if : ${{ inputs.lanes == 'all' || contains(fromJSON(inputs.lanes), 'lint') }}
1319 # Pinned, not ubuntu-latest: the LLVM install below adds an
1420 # apt.llvm.org llvm-toolchain-NOBLE repo, which is 24.04 by name. When
1521 # GitHub moves ubuntu-latest to the next LTS this job breaks on a day
1622 # nobody chose. Pin the runner to the release the repo line already names.
1723 runs-on : ubuntu-24.04
1824 # 15 min proved too tight on a slow runner day and a timed-out lint reads
1925 # as "cancelled", which the release graph must treat as a hard stop; keep
20- # a bound, but one only a genuine hang can hit (normal runtime ~5 min).
21- 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
2231 steps :
2332 - uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
2433
@@ -28,14 +37,16 @@ jobs:
2837 run : bash scripts/check-no-test-skips.sh
2938
3039 - name : Install build deps
31- 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
3242
3343 - name : Install LLVM 20
44+ timeout-minutes : 10
3445 run : |
3546 wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
3647 echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-20 main" | sudo tee /etc/apt/sources.list.d/llvm-20.list
37- sudo apt-get update
38- 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
3950
4051 - uses : actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
4152 id : cppcheck-cache
@@ -64,21 +75,24 @@ jobs:
6475 # provability (never suppressed — the NOLINT ban applies here too).
6576 # Vendored-tree diagnostics are path-filtered, mirroring .cppcheck.
6677 lint-mem :
78+ if : ${{ inputs.lanes == 'all' || contains(fromJSON(inputs.lanes), 'lint-mem') }}
6779 # Pinned for the same reason as `lint`: llvm-toolchain-noble-21 below.
6880 runs-on : ubuntu-24.04
6981 timeout-minutes : 60
7082 steps :
7183 - uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
7284
7385 - name : Install build deps
74- 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
7588
7689 - name : Install LLVM 21 (pinned analyzer toolchain)
90+ timeout-minutes : 10
7791 run : |
7892 wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
7993 echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-21 main" | sudo tee /etc/apt/sources.list.d/llvm-21.list
80- sudo apt-get update
81- 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
8296
8397 - name : Memory-analyzer gate
8498 run : scripts/ci/lint-mem.sh clang-tidy-21
0 commit comments