feat(v11): CI/CD + regression tests + fuzzing + benchmarks + code quality
v11.1 — Test Infrastructure (14 files): - .github/workflows/ci.yml: Ubuntu 22.04 + GCC 11, auto ctest on push - tests/regression/: degenerate geometry, extreme coords, thin wall, large models - tests/fuzz/: SDF random CSG, random booleans, format round-trip, continuous mode - tests/benchmark/: boolean perf, MC perf, IO perf benchmarks - docs/benchmark-report.md: benchmark template v11.2 — Code Quality + Docs: - .clang-tidy: 15 check categories, 22 exclusions - .github/workflows/static-analysis.yml: clang-tidy CI scan - CODEOWNERS, SECURITY.md - docs: API overview, testing guide, contributing guide - README: module capability overview table Pending: binary formats + curve projection (retrying)
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
# ── ViewDesignEngine 代码所有者 ────────────────────────────────────
|
||||
# 规则: 最后匹配的行生效。* 匹配所有文件。
|
||||
# 所有者: @用户名 或 team/团队名
|
||||
|
||||
# 核心引擎(所有模块)
|
||||
* @hm @engine-team
|
||||
|
||||
# B-Rep 建模核心
|
||||
include/vde/brep/** @hm @brep-team
|
||||
src/brep/** @hm @brep-team
|
||||
tests/brep/** @hm @brep-team
|
||||
|
||||
# 曲线曲面
|
||||
include/vde/curves/** @hm @curves-team
|
||||
src/curves/** @hm @curves-team
|
||||
tests/curves/** @hm @curves-team
|
||||
|
||||
# 网格处理
|
||||
include/vde/mesh/** @hm @mesh-team
|
||||
src/mesh/** @hm @mesh-team
|
||||
tests/mesh/** @hm @mesh-team
|
||||
|
||||
# CAM 加工
|
||||
include/vde/core/cam_* @hm @cam-team
|
||||
src/core/cam_* @hm @cam-team
|
||||
|
||||
# 隐式建模 (SDF)
|
||||
include/vde/sdf/** @hm @sdf-team
|
||||
src/sdf/** @hm @sdf-team
|
||||
tests/sdf/** @hm @sdf-team
|
||||
|
||||
# 工业格式 I/O
|
||||
include/vde/foundation/io_* @hm @format-team
|
||||
include/vde/foundation/industrial_formats.h @hm @format-team
|
||||
src/foundation/io_* @hm @format-team
|
||||
src/foundation/industrial_formats.cpp @hm @format-team
|
||||
tests/foundation/test_io_* @hm @format-team
|
||||
|
||||
# 构建系统 & CI
|
||||
CMakeLists.txt @hm @build-team
|
||||
cmake/** @hm @build-team
|
||||
.github/** @hm @build-team
|
||||
Dockerfile* @hm @build-team
|
||||
docker/** @hm @build-team
|
||||
|
||||
# Python 绑定
|
||||
python/** @hm @python-team
|
||||
pyproject.toml @hm @python-team
|
||||
|
||||
# 文档
|
||||
docs/** @hm @docs-team
|
||||
*.md @hm @docs-team
|
||||
|
||||
# 配置文件
|
||||
.clang-tidy @hm @build-team
|
||||
.clang-format @hm @build-team
|
||||
.gitignore @hm @build-team
|
||||
CHANGELOG.md @hm @docs-team
|
||||
LICENSE @hm
|
||||
@@ -0,0 +1,66 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main, master, develop, 'v*', 'feature/*']
|
||||
pull_request:
|
||||
branches: [main, master]
|
||||
|
||||
jobs:
|
||||
build-and-test:
|
||||
name: Ubuntu 22.04 • GCC 11 • CMake
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
build_type: [Debug, Release]
|
||||
|
||||
steps:
|
||||
- name: 检出代码
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: 安装依赖
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y \
|
||||
g++-11 \
|
||||
cmake \
|
||||
ninja-build \
|
||||
libeigen3-dev
|
||||
|
||||
- name: 配置 CMake
|
||||
env:
|
||||
CC: gcc-11
|
||||
CXX: g++-11
|
||||
run: |
|
||||
cmake -B build \
|
||||
-G Ninja \
|
||||
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
|
||||
-DBUILD_TESTS=ON \
|
||||
-DBUILD_BENCHMARKS=OFF \
|
||||
-DBUILD_EXAMPLES=OFF \
|
||||
-DVDE_BUILD_PYTHON=OFF \
|
||||
-DCMAKE_CXX_FLAGS="-Wall -Wextra -Wpedantic"
|
||||
|
||||
- name: 编译
|
||||
run: cmake --build build --parallel $(nproc)
|
||||
|
||||
- name: 运行测试
|
||||
working-directory: build
|
||||
run: |
|
||||
ctest --output-on-failure \
|
||||
--test-dir . \
|
||||
-j $(nproc) \
|
||||
--timeout 300
|
||||
|
||||
- name: 上传测试结果
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: test-results-${{ matrix.build_type }}
|
||||
path: |
|
||||
build/Testing/Temporary/LastTest.log
|
||||
build/Testing/**/*.xml
|
||||
@@ -0,0 +1,92 @@
|
||||
name: Static Analysis
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
paths:
|
||||
- 'include/**'
|
||||
- 'src/**'
|
||||
- 'tests/**'
|
||||
- '.clang-tidy'
|
||||
pull_request:
|
||||
branches: [main]
|
||||
paths:
|
||||
- 'include/**'
|
||||
- 'src/**'
|
||||
- 'tests/**'
|
||||
- '.clang-tidy'
|
||||
schedule:
|
||||
- cron: '0 3 * * 1' # 每周一凌晨3点全量扫描
|
||||
workflow_dispatch: # 手动触发
|
||||
|
||||
jobs:
|
||||
clang-tidy:
|
||||
name: clang-tidy scan (GCC 11.4)
|
||||
runs-on: ubuntu-22.04
|
||||
container:
|
||||
image: vde-builder:latest
|
||||
options: --cpus=2 --memory=8g
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Install clang-tidy
|
||||
run: |
|
||||
apt-get update -qq
|
||||
apt-get install -y -qq clang-tidy-15
|
||||
|
||||
- name: Generate compile_commands.json
|
||||
run: |
|
||||
cmake -B build_analysis \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
|
||||
-DBUILD_TESTS=ON \
|
||||
-DBUILD_EXAMPLES=OFF \
|
||||
-DBUILD_BENCHMARKS=OFF \
|
||||
-DVDE_BUILD_PYTHON=OFF \
|
||||
-DVDE_USE_OPENMP=ON
|
||||
cmake --build build_analysis -j2 --target vde_foundation vde_core vde_curves vde_mesh vde_spatial vde_boolean vde_collision vde_brep vde_sdf vde_sketch vde_capi
|
||||
|
||||
- name: Run clang-tidy
|
||||
run: |
|
||||
run-clang-tidy-15 \
|
||||
-p build_analysis \
|
||||
-j2 \
|
||||
-header-filter='include/vde/.*\.h$' \
|
||||
2>&1 | tee clang-tidy-report.txt
|
||||
continue-on-error: true
|
||||
|
||||
- name: Summarize results
|
||||
if: always()
|
||||
run: |
|
||||
echo "## clang-tidy Results" >> $GITHUB_STEP_SUMMARY
|
||||
echo '```' >> $GITHUB_STEP_SUMMARY
|
||||
WARNINGS=$(grep -c 'warning:' clang-tidy-report.txt || echo 0)
|
||||
ERRORS=$(grep -c 'error:' clang-tidy-report.txt || echo 0)
|
||||
echo "Total warnings: $WARNINGS" >> $GITHUB_STEP_SUMMARY
|
||||
echo "Total errors: $ERRORS" >> $GITHUB_STEP_SUMMARY
|
||||
echo '```' >> $GITHUB_STEP_SUMMARY
|
||||
if [ "$ERRORS" -gt 0 ]; then
|
||||
echo "⚠️ Found $ERRORS clang-tidy errors" >> $GITHUB_STEP_SUMMARY
|
||||
fi
|
||||
|
||||
- name: Upload clang-tidy report
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: clang-tidy-report
|
||||
path: clang-tidy-report.txt
|
||||
retention-days: 30
|
||||
if-no-files-found: ignore
|
||||
|
||||
- name: Upload compile_commands.json
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: compile-commands
|
||||
path: build_analysis/compile_commands.json
|
||||
retention-days: 7
|
||||
if-no-files-found: ignore
|
||||
Reference in New Issue
Block a user