Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,24 @@ jobs:
- name: Add cppcheck to PATH
run: echo "/opt/cppcheck/bin" >> "$GITHUB_PATH"

# Incremental cppcheck build directory (PRs only: release and dry-run
# gates always run cppcheck from a fresh ephemeral temp dir). Keyed on
# .cppcheck + Makefile.cbm so any suppression, flag, or LINT_SRCS change
# starts clean while unchanged TUs reuse verified .a1/.ctu-info state and
# cppcheck still runs full whole-program CTU analysis.
- name: cppcheck analysis cache
if: ${{ github.event_name == 'pull_request' }}
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ github.workspace }}/.cppcheck-build
key: cppcheck-build-2.20.0-${{ hashFiles('.cppcheck', 'Makefile.cbm') }}-${{ github.ref }}-${{ github.sha }}
restore-keys: |
cppcheck-build-2.20.0-${{ hashFiles('.cppcheck', 'Makefile.cbm') }}-${{ github.ref }}-
cppcheck-build-2.20.0-${{ hashFiles('.cppcheck', 'Makefile.cbm') }}-
- name: Lint (cppcheck + clang-format, no clang-tidy — enforced locally)
env:
CPPCHECK_BUILD_DIR: ${{ github.event_name == 'pull_request' && format('{0}/.cppcheck-build', github.workspace) || '' }}
run: scripts/lint.sh --ci CLANG_FORMAT=clang-format-20

# Memory-analyzer gate (user decision 2026-08-03: runner cost accepted).
Expand Down
19 changes: 14 additions & 5 deletions .github/workflows/_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ jobs:
CBM_SKIP_PERF: ${{ inputs.skip_perf && '1' || '' }}
CBM_TEST_SELECTION_DIR: ${{ inputs.test_selection != '' && runner.os == 'Linux' && runner.arch == 'X64' && format('{0}/test-selection', runner.temp) || inputs.test_selection != '' && inputs.test_selection_portable && format('{0}/test-selection/portable', runner.temp) || '' }}
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_MAXSIZE: 1500M
CCACHE_MAXSIZE: 2500M

# Every shard of a leg builds the identical runner, so one shard's
# cache carries the complete object set: shard 1 (or the unsharded
Expand Down Expand Up @@ -388,6 +388,10 @@ jobs:
echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-21 main" | sudo tee /etc/apt/sources.list.d/llvm-21.list
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 clang-21
# ccache was installed before clang-21, so update-ccache-symlinks did
# not create masquerade links for clang-21/clang++-21.
sudo ln -sf /usr/bin/ccache /usr/lib/ccache/clang-21
sudo ln -sf /usr/bin/ccache /usr/lib/ccache/clang++-21
- name: Compiler cache (content-verified, restore)
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
Expand All @@ -405,6 +409,8 @@ jobs:
- name: Test (clang-21, ASan+UBSan + off-by-default ASan checks)
env:
ASAN_OPTIONS: "detect_stack_use_after_return=1:strict_string_checks=1:detect_stack_use_after_scope=1"
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_MAXSIZE: 2500M
run: |
scripts/test.sh CC=clang-21 CXX=clang++-21 \
SANITIZE="-fsanitize=address,undefined -fno-omit-frame-pointer -fno-optimize-sibling-calls"
Expand Down Expand Up @@ -510,9 +516,12 @@ jobs:
- name: Test (Homebrew clang, ASan + LeakSanitizer)
env:
ASAN_OPTIONS: "detect_leaks=1:halt_on_error=1"
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_MAXSIZE: 2500M
run: |
LLVM_PREFIX="$(brew --prefix llvm@22)"
scripts/test.sh CC="$LLVM_PREFIX/bin/clang" CXX="$LLVM_PREFIX/bin/clang++"
export PATH="$LLVM_PREFIX/bin:$PATH"
scripts/test.sh CC=clang CXX=clang++
# Same step as in test-unix: the complete logs of the suites that did
# not end green, only when the job failed.
Expand Down Expand Up @@ -581,7 +590,7 @@ jobs:
scripts/test.sh --tsan CC=${{ matrix.cc }} CXX=${{ matrix.cxx }}
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_MAXSIZE: 1500M
CCACHE_MAXSIZE: 2500M

- name: ccache stats
if: always()
Expand Down Expand Up @@ -681,7 +690,7 @@ jobs:
# The portable view, as on test-unix's arm64 and macOS legs.
CBM_TEST_SELECTION_DIR: ${{ inputs.test_selection != '' && inputs.test_selection_portable && format('{0}/test-selection/portable', runner.temp) || '' }}
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_MAXSIZE: 1500M
CCACHE_MAXSIZE: 2500M

- name: ccache stats
if: always()
Expand Down Expand Up @@ -801,7 +810,7 @@ jobs:
run: scripts/build.sh --with-ui CC=clang CXX=clang++ TEST_SEAMS=1
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_MAXSIZE: 1500M
CCACHE_MAXSIZE: 2500M

- name: Windows regression guards (#636/#357, #618, #548, #423/#20)
shell: pwsh
Expand Down
28 changes: 22 additions & 6 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -252,14 +252,16 @@ jobs:
unzip
# Verified compiler cache — content-keyed, stale hits impossible by
# construction (see scripts/env.sh).
# construction (see scripts/env.sh). Cross-ref fallback matches _test.yml
# so fresh PRs start warm from main's cache instead of building cold.
- name: Compiler cache (content-verified)
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ github.workspace }}/.ccache
key: ccache-smoke-${{ matrix.os }}-${{ github.ref }}-${{ github.sha }}
restore-keys: |
ccache-smoke-${{ matrix.os }}-${{ github.ref }}-
ccache-smoke-${{ matrix.os }}-
- name: Build prod + smoke (Ubuntu)
if: matrix.os == 'ubuntu-latest'
Expand All @@ -268,7 +270,7 @@ jobs:
scripts/smoke-local.sh "$(pwd)/build/c/codebase-memory-mcp"
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_MAXSIZE: 1000M
CCACHE_MAXSIZE: 1500M
SMOKE_REQUIRE_WRAPPERS: "1"

- name: Build prod + smoke (macOS)
Expand All @@ -279,7 +281,7 @@ jobs:
scripts/smoke-local.sh "$(pwd)/build/c/codebase-memory-mcp"
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_MAXSIZE: 1000M
CCACHE_MAXSIZE: 1500M
SMOKE_REQUIRE_WRAPPERS: "1"

- name: Build prod + smoke (Windows)
Expand All @@ -290,7 +292,7 @@ jobs:
SMOKE_ARCH=amd64 bash test-infrastructure/vm/vm-smoke.sh
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_MAXSIZE: 1000M
CCACHE_MAXSIZE: 1500M
SMOKE_REQUIRE_WRAPPERS: "1"

# ── Waste sanitizer, REPORT-ONLY: memory + CPU waste on this repository and
Expand Down Expand Up @@ -334,11 +336,22 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}
run: scripts/ci/test-impact-shadow.sh --fetch-release "$RUNNER_TEMP/cbm-bin"
- name: Compiler cache (content-verified)
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ github.workspace }}/.ccache
key: ccache-shadow-ubuntu-latest-gcc-${{ github.ref }}-${{ github.sha }}
restore-keys: |
ccache-shadow-ubuntu-latest-gcc-${{ github.ref }}-
ccache-shadow-ubuntu-latest-gcc-
- name: Build the binary from this checkout (download failed)
if: ${{ steps.release.outcome == 'failure' }}
timeout-minutes: 20
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_MAXSIZE: 1500M
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
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 ccache
scripts/build.sh CC=gcc CXX=g++
mkdir -p "$RUNNER_TEMP/cbm-bin"
cp build/c/codebase-memory-mcp "$RUNNER_TEMP/cbm-bin/"
Expand All @@ -349,8 +362,11 @@ jobs:
- name: Build this checkout's engine
if: ${{ steps.release.outcome != 'failure' }}
timeout-minutes: 20
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_MAXSIZE: 1500M
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
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 ccache
scripts/build.sh CC=gcc CXX=g++
- name: Select with the team artifact (engine shadow)
env:
Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/test-impact-artifact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,25 @@ jobs:
- name: Install build deps and LLVM 21 (coverage toolchain)
timeout-minutes: 10
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
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 ccache
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-21 main" | sudo tee /etc/apt/sources.list.d/llvm-21.list
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 clang-21 llvm-21 libclang-rt-21-dev
- name: Compiler cache (content-verified)
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ github.workspace }}/.ccache
key: ccache-impact-ubuntu-24.04-${{ github.ref }}-${{ github.sha }}
restore-keys: |
ccache-impact-ubuntu-24.04-${{ github.ref }}-
ccache-impact-ubuntu-24.04-
- name: Build the production binary and the coverage runner
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_MAXSIZE: 2500M
run: |
scripts/build.sh CC=gcc CXX=g++
make -f Makefile.cbm test-runner-cov COV_LLVM_BIN=/usr/lib/llvm-21/bin -j"$(nproc)"
Expand Down
Loading
Loading