9427dd075d
Three fixes from the v0.10.7 release incident (2026-08-18): 1. build (and smoke/soak) required 'not failed' instead of explicit success. failure() does not cover a needed job that TIMED OUT (conclusion 'cancelled'), so lint hitting its 15-min timeout cascaded test into 'skipped' and the pipeline published with the whole test matrix and asan-soak silently skipped. build now requires lint success plus either test success or the sanctioned skip_tests input; smoke/soak require build success explicitly. 2. The tag is inputs.version verbatim: dispatching a bare '0.10.7' published a release the installers can never resolve (they fetch releases/download/v<version>/...), and under immutable releases the mis-named tag cannot be retagged or its name reused. A preflight job now refuses any non-v-prefixed version before anything runs. 3. Lint's 15-min timeout was one slow-runner day away from cancelling a normally-5-min job; raised to 30 so only a genuine hang can hit it. Release-path only (workflow_dispatch); adds one ~5s preflight job; no PR-CI gating, cost, or trigger changes. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
80 lines
3.3 KiB
YAML
80 lines
3.3 KiB
YAML
# Reusable: lint only (cppcheck + clang-format).
|
|
# Security-static and CodeQL gate are separate — see _security.yml.
|
|
name: Lint & Security
|
|
|
|
on:
|
|
workflow_call: {}
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
# 15 min proved too tight on a slow runner day and a timed-out lint reads
|
|
# as "cancelled", which the release graph must treat as a hard stop; keep
|
|
# a bound, but one only a genuine hang can hit (normal runtime ~5 min).
|
|
timeout-minutes: 30
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
|
|
# Tests must pass or fail — no SKIPs except genuinely platform-specific
|
|
# ones (SKIP_PLATFORM / #ifdef). Fails the lint phase on any plain SKIP().
|
|
- name: No-skips policy (tests pass or fail)
|
|
run: bash scripts/check-no-test-skips.sh
|
|
|
|
- name: Install build deps
|
|
run: sudo apt-get update && sudo apt-get install -y zlib1g-dev cmake
|
|
|
|
- name: Install LLVM 20
|
|
run: |
|
|
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
|
|
echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-20 main" | sudo tee /etc/apt/sources.list.d/llvm-20.list
|
|
sudo apt-get update
|
|
sudo apt-get install -y clang-format-20
|
|
|
|
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
|
id: cppcheck-cache
|
|
with:
|
|
path: /opt/cppcheck
|
|
key: cppcheck-2.20.0-ubuntu-amd64
|
|
|
|
- name: Build cppcheck 2.20.0
|
|
if: steps.cppcheck-cache.outputs.cache-hit != 'true'
|
|
run: |
|
|
git clone --depth 1 --branch 2.20.0 https://github.com/danmar/cppcheck.git /tmp/cppcheck
|
|
cmake -S /tmp/cppcheck -B /tmp/cppcheck/build -DCMAKE_BUILD_TYPE=Release -DHAVE_RULES=OFF -DCMAKE_INSTALL_PREFIX=/opt/cppcheck
|
|
cmake --build /tmp/cppcheck/build -j$(nproc)
|
|
cmake --install /tmp/cppcheck/build
|
|
|
|
- name: Add cppcheck to PATH
|
|
run: echo "/opt/cppcheck/bin" >> "$GITHUB_PATH"
|
|
|
|
- name: Lint (cppcheck + clang-format, no clang-tidy — enforced locally)
|
|
run: scripts/lint.sh --ci CLANG_FORMAT=clang-format-20
|
|
|
|
# Memory-analyzer gate (user decision 2026-08-03: runner cost accepted).
|
|
# Path-sensitive clang-analyzer over the memory checks only: leak paths,
|
|
# null derefs, uninitialized reads. Its first run produced 9 real fixes;
|
|
# the gate is green because every false positive was RESTRUCTURED for
|
|
# provability (never suppressed — the NOLINT ban applies here too).
|
|
# Vendored-tree diagnostics are path-filtered, mirroring .cppcheck.
|
|
lint-mem:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 60
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
|
|
- name: Install build deps
|
|
run: sudo apt-get update && sudo apt-get install -y zlib1g-dev
|
|
|
|
- name: Install LLVM 22 (pinned analyzer toolchain)
|
|
run: |
|
|
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
|
|
echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-22 main" | sudo tee /etc/apt/sources.list.d/llvm-22.list
|
|
sudo apt-get update
|
|
sudo apt-get install -y clang-tidy-22
|
|
|
|
- name: Memory-analyzer gate
|
|
run: scripts/ci/lint-mem.sh clang-tidy-22
|