Add clang-tidy, codespell, and sanitizer checks to CI pipeline
Summary
Adds new CI checks across MR and nightly pipelines.
MR pipeline (advisory, allow_failure: true)
-
clang-tidy: Diff-based semantic analysis on changed files with a conservative check set tuned for template-heavy math code. Includes a runner script that generates driver
.cppfiles for header-only Eigen modules soInternalHeaderCheck.hdoesn't error out. -
codespell: Catches common misspellings in comments, strings, and identifiers. Config in
setup.cfgfor compatibility with codespell 2.2.6 on Alpine 3.20. -
ASAN+UBSAN smoke tests: Combined address and UB sanitizer build+test with reduced parallelism (2 jobs) and per-test timeouts. Leak detection disabled to prevent LSan exit-time hangs. Uses
-fno-sanitize-recover=addressso ASAN errors abort but pre-existing UBSAN issues only warn. Compiled with-fno-omit-frame-pointerand run withprint_stacktrace=1andllvm-symbolizerfor symbolized stack traces.
Nightly pipeline (full test suite)
-
Full ASAN+UBSAN (
clang-19, ubuntu:24.04): Single combined build and test for Official + Unsupported with-fsanitize=address,undefined. Compiled with-fno-omit-frame-pointer; tests run withprint_stacktrace=1in bothASAN_OPTIONSandUBSAN_OPTIONS, andASAN_SYMBOLIZER_PATHset tollvm-19'sllvm-symbolizerfor fully symbolized stack traces. 2000s test timeout for ~2x sanitizer overhead. Leak detection disabled. UB sanitizer errors are non-recoverable (-fno-sanitize-recover=undefined).
All MR checks are advisory (allow_failure: true) to avoid blocking existing workflows. All sanitizer runs (both MR smoke and nightly) produce symbolized stack traces via -fno-omit-frame-pointer, print_stacktrace=1, and llvm-symbolizer.
Files changed
| File | Change |
|---|---|
.clang-tidy |
New — project-root clang-tidy config |
setup.cfg |
New — codespell config with skip paths and ignore list |
ci/scripts/run-clang-tidy.sh |
New — diff-based clang-tidy runner for header-only code |
ci/checkformat.gitlab-ci.yml |
Added clang-tidy and codespell CI jobs |
ci/build.linux.gitlab-ci.yml |
Added combined ASAN+UBSAN builds (MR smoke + nightly) |
ci/test.linux.gitlab-ci.yml |
Added combined ASAN+UBSAN tests (MR smoke + nightly) with symbolized stack traces |
ci/scripts/test.linux.script.sh |
Made parallelism overridable via EIGEN_CI_CTEST_PARALLEL
|
Test plan
- Verify clang-tidy job runs on MR and reports issues on changed files
- Verify codespell job runs and completes cleanly
- Verify combined ASAN+UBSAN smoke tests build and run with reduced parallelism
- Verify nightly combined ASAN+UBSAN full test suite runs with symbolized stack traces
Edited by Rasmus Munk Larsen