### 下线 hosted runner - .gitea/workflows、.github/workflows 归档到 docs/ci-templates/(仅自备 runner 可选启用,不作为门禁);活跃 workflow 目录移除; - 新增 tools/vde_local_check.py:--quick(构建+快速 ctest)、--full(全量 ctest)、--module、--wp-check、--build-dir/--no-configure/--jobs/--timeout; 日志/summary 落 build-local-check/<timestamp>/;实测 quick 168/168、full 7475/7475、wp-check PASS; - testing/reference 76/cross-platform 文档改为本地验证 + verifier 门禁; ### 拉取式任务计划 - 根 NEXT_STEPS.md:10 分钟上手/优先队列/T1–T8 下一步目标表/回报约定; - docs/planning/team-briefs/T1..T8.md(使命/边界/下一步/验证/交接); - WP 工具新增 --next/--team-plan/--export-all,非法 --status RC=2;WP-P4-19(1.0.81,Delivered),统计 41=29+12; - issue/PR/流程/多团队文档验证证据改为 local check + verifier; ### 工程 - 版本 1.0.81;全量构建 0 error(353 targets);全量 ctest 7570 注册、7475/7475 PASS(0 failed,25 skipped,221.94s)。
495 lines
17 KiB
YAML
495 lines
17 KiB
YAML
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
|
||
timeout-minutes: 90
|
||
|
||
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
|
||
|
||
# ── D5: ThreadSanitizer 线程安全 ──
|
||
# TSan 与 libgomp(OpenMP)存在已知不兼容(死锁/误报),故关闭 OpenMP
|
||
# 编译,检测 std::thread/std::async 等非 OpenMP 并行路径。
|
||
tsan:
|
||
name: Ubuntu 22.04 • TSan
|
||
runs-on: ubuntu-22.04
|
||
timeout-minutes: 90
|
||
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 util-linux
|
||
|
||
- name: 配置 (TSan)
|
||
env:
|
||
CC: gcc-11
|
||
CXX: g++-11
|
||
run: |
|
||
cmake -B build \
|
||
-G Ninja \
|
||
-DCMAKE_BUILD_TYPE=Debug \
|
||
-DBUILD_TESTS=ON \
|
||
-DBUILD_BENCHMARKS=OFF \
|
||
-DBUILD_EXAMPLES=OFF \
|
||
-DVDE_BUILD_PYTHON=OFF \
|
||
-DVDE_USE_OPENMP=OFF \
|
||
-DCMAKE_CXX_FLAGS="-fsanitize=thread -fno-omit-frame-pointer" \
|
||
-DCMAKE_EXE_LINKER_FLAGS="-fsanitize=thread"
|
||
|
||
- name: 编译
|
||
run: cmake --build build --parallel $(nproc)
|
||
|
||
- name: 运行测试 (TSan)
|
||
working-directory: build
|
||
env:
|
||
TSAN_OPTIONS: halt_on_error=1
|
||
run: |
|
||
# 规避 GitHub runner ASLR 与 TSan 的 unexpected memory mapping 冲突
|
||
setarch $(uname -m) -R ctest --output-on-failure --test-dir . \
|
||
-j 2 --timeout 300 \
|
||
-E 'Benchmark|bench_|Fuzz|LargeModel|Stress|Regression' || \
|
||
ctest --output-on-failure --test-dir . -j 2 --timeout 300 \
|
||
-E 'Benchmark|bench_|Fuzz|LargeModel|Stress|Regression'
|
||
|
||
# ── D6: AddressSanitizer / UndefinedBehaviorSanitizer ──
|
||
sanitizer:
|
||
name: Ubuntu 22.04 • ASan+UBSan
|
||
runs-on: ubuntu-22.04
|
||
timeout-minutes: 120
|
||
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: 配置 (ASan+UBSan)
|
||
env:
|
||
CC: gcc-11
|
||
CXX: g++-11
|
||
run: |
|
||
cmake -B build \
|
||
-G Ninja \
|
||
-DCMAKE_BUILD_TYPE=Debug \
|
||
-DBUILD_TESTS=ON \
|
||
-DBUILD_BENCHMARKS=OFF \
|
||
-DBUILD_EXAMPLES=OFF \
|
||
-DVDE_BUILD_PYTHON=OFF \
|
||
-DCMAKE_CXX_FLAGS="-fsanitize=address,undefined -fno-omit-frame-pointer" \
|
||
-DCMAKE_EXE_LINKER_FLAGS="-fsanitize=address,undefined"
|
||
|
||
- name: 编译
|
||
run: cmake --build build --parallel $(nproc)
|
||
|
||
- name: 运行测试 (ASan+UBSan)
|
||
working-directory: build
|
||
env:
|
||
ASAN_OPTIONS: detect_leaks=1:halt_on_error=1
|
||
UBSAN_OPTIONS: halt_on_error=1
|
||
run: |
|
||
ctest --output-on-failure --test-dir . -j 2 --timeout 300
|
||
|
||
# ── D4: Valgrind 内存检测 ──
|
||
valgrind:
|
||
name: Ubuntu 22.04 • Valgrind memcheck
|
||
runs-on: ubuntu-22.04
|
||
timeout-minutes: 60
|
||
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 valgrind
|
||
|
||
- name: 配置
|
||
env:
|
||
CC: gcc-11
|
||
CXX: g++-11
|
||
run: |
|
||
cmake -B build \
|
||
-G Ninja \
|
||
-DCMAKE_BUILD_TYPE=Debug \
|
||
-DBUILD_TESTS=ON \
|
||
-DBUILD_BENCHMARKS=OFF \
|
||
-DBUILD_EXAMPLES=OFF \
|
||
-DVDE_BUILD_PYTHON=OFF
|
||
|
||
- name: 编译
|
||
run: cmake --build build --parallel $(nproc)
|
||
|
||
- name: 选择代表性测试
|
||
working-directory: build
|
||
run: |
|
||
# 选取纯内核核心测试(排除耗时/重型套件)
|
||
ctest -N | grep -E 'core|curves|collision|boolean|spatial' | head -n 40
|
||
|
||
- name: Valgrind 运行
|
||
working-directory: build
|
||
run: |
|
||
valgrind --error-exitcode=1 --leak-check=full \
|
||
--errors-for-leak-kinds=definite,possible \
|
||
ctest --test-dir . -j 1 --timeout 600 -R 'test_nurbs|test_gjk|test_sat|test_icp|test_bvh|test_boolean_2d' \
|
||
--output-on-failure 2>&1 | tail -n 100 || true
|
||
|
||
# ── D7: Codecov 覆盖率报告 ──
|
||
coverage:
|
||
name: Ubuntu 22.04 • Coverage + Codecov
|
||
runs-on: ubuntu-22.04
|
||
timeout-minutes: 90
|
||
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 lcov
|
||
|
||
- name: 配置 (Coverage)
|
||
env:
|
||
CC: gcc-11
|
||
CXX: g++-11
|
||
run: |
|
||
cmake -B build \
|
||
-G Ninja \
|
||
-DCMAKE_BUILD_TYPE=Debug \
|
||
-DBUILD_TESTS=ON \
|
||
-DBUILD_BENCHMARKS=OFF \
|
||
-DBUILD_EXAMPLES=OFF \
|
||
-DVDE_BUILD_PYTHON=OFF \
|
||
-DCMAKE_CXX_FLAGS="--coverage -fno-omit-frame-pointer" \
|
||
-DCMAKE_EXE_LINKER_FLAGS="--coverage"
|
||
|
||
- name: 编译
|
||
run: cmake --build build --parallel $(nproc)
|
||
|
||
- name: 运行测试
|
||
working-directory: build
|
||
run: |
|
||
ctest --output-on-failure --test-dir . -j $(nproc) --timeout 300 \
|
||
-E 'Benchmark|bench_|Fuzz|LargeModel|Stress'
|
||
|
||
- name: 收集覆盖率
|
||
working-directory: build
|
||
run: |
|
||
lcov --capture --directory . --output-file coverage.info \
|
||
--rc lcov_branch_coverage=1 2>/dev/null | tail -n 5 || true
|
||
lcov --remove coverage.info \
|
||
'*/eigen3/*' '*/googletest/*' '*/tests/*' '*/build/*' \
|
||
--output-file coverage.info --rc lcov_branch_coverage=1 2>/dev/null | tail -n 5 || true
|
||
lcov --summary coverage.info --rc lcov_branch_coverage=1 || true
|
||
|
||
- name: 上传 Codecov
|
||
uses: codecov/codecov-action@v4
|
||
with:
|
||
files: coverage.info
|
||
fail_ci_if_error: false
|
||
|
||
# ── D8: 性能回归检测 ──
|
||
perf-regression:
|
||
name: Ubuntu 22.04 • Perf regression
|
||
runs-on: ubuntu-22.04
|
||
timeout-minutes: 60
|
||
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 python3
|
||
|
||
- name: 配置
|
||
env:
|
||
CC: gcc-11
|
||
CXX: g++-11
|
||
run: |
|
||
cmake -B build \
|
||
-G Ninja \
|
||
-DCMAKE_BUILD_TYPE=Release \
|
||
-DBUILD_TESTS=OFF \
|
||
-DBUILD_BENCHMARKS=ON \
|
||
-DBUILD_EXAMPLES=OFF \
|
||
-DVDE_BUILD_PYTHON=OFF
|
||
|
||
- name: 编译
|
||
run: cmake --build build --parallel $(nproc) --target vde_benchmarks
|
||
|
||
- name: 建立/对比性能基线
|
||
run: |
|
||
chmod +x tools/perf_regression.sh
|
||
if [ ! -f build/perf_baseline.json ]; then
|
||
tools/perf_regression.sh --update
|
||
else
|
||
tools/perf_regression.sh
|
||
fi
|
||
|
||
- name: 上传性能基线(供下次对比)
|
||
uses: actions/upload-artifact@v4
|
||
with:
|
||
name: perf-baseline
|
||
path: build/perf_baseline.json
|
||
|
||
# ── P3-7: Windows MSVC 跨平台构建验证(新增;Linux GCC job 见上)──
|
||
windows-msvc:
|
||
name: Windows Server 2022 • MSVC 2022 • CMake
|
||
runs-on: windows-2022
|
||
timeout-minutes: 120
|
||
|
||
steps:
|
||
- name: 检出代码
|
||
uses: actions/checkout@v4
|
||
with:
|
||
submodules: recursive
|
||
|
||
# 说明(P3-7 审计):本仓库大量头文件直接使用 M_PI(404 处),
|
||
# MSVC 的 <cmath> 需要 _USE_MATH_DEFINES 才暴露该宏;根 CMake 目前只在
|
||
# GNU/MinGW 下加该定义(见 CMakeLists.txt 第 276 行),故 CI 在 C/CXX 公共
|
||
# flags 中显式补上,避免 Windows job 因 M_PI 未定义而失败。
|
||
# 长期修复建议:把该定义补进 cmake/CompilerSettings.cmake 的 MSVC 分支。
|
||
- name: 配置 CMake (MSVC Release)
|
||
run: >
|
||
cmake -B build -G "Visual Studio 17 2022" -A x64
|
||
-DBUILD_TESTS=ON -DBUILD_BENCHMARKS=OFF -DBUILD_EXAMPLES=OFF
|
||
-DVDE_BUILD_PYTHON=OFF
|
||
-DVDE_USE_OPENMP=OFF
|
||
-DCMAKE_CXX_FLAGS="/D_USE_MATH_DEFINES"
|
||
-DCMAKE_C_FLAGS="/D_USE_MATH_DEFINES"
|
||
|
||
- name: 编译 (Release)
|
||
run: cmake --build build --config Release --parallel $env:NUMBER_OF_PROCESSORS
|
||
|
||
- name: 运行测试 (Release)
|
||
working-directory: build
|
||
run: >
|
||
ctest --output-on-failure -C Release
|
||
-j $env:NUMBER_OF_PROCESSORS --timeout 300
|
||
-E "Fuzz|Benchmark|LargeModel|Stress|Regression"
|
||
|
||
- name: 上传测试结果
|
||
if: always()
|
||
uses: actions/upload-artifact@v4
|
||
with:
|
||
name: test-results-windows-msvc
|
||
path: |
|
||
build/Testing/Temporary/LastTest.log
|
||
build/Testing/**/*.xml
|
||
|
||
# ── VDE-1251:嵌入式消费者回归(宿主 add_subdirectory(VDE) + 宿主普通 _vd_eigen3)──
|
||
# 防回归:VDE-1250 曾在宿主自带 FindEigen3 创建非 IMPORTED target 时,install(EXPORT
|
||
# vde-kernel-targets) Generate 失败;同时覆盖 VDE_INSTALL=ON/OFF 两种嵌入配置。
|
||
embedding-consumer:
|
||
name: Ubuntu 22.04 • Embedding consumer (add_subdirectory, VDE_INSTALL ON/OFF)
|
||
runs-on: ubuntu-22.04
|
||
timeout-minutes: 45
|
||
|
||
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: 准备嵌入宿主工程(宿主自带 FindEigen3 -> 普通 _vd_eigen3)
|
||
run: |
|
||
mkdir -p "$RUNNER_TEMP/embed-host/cmake"
|
||
cat > "$RUNNER_TEMP/embed-host/cmake/FindEigen3.cmake" <<'EOF'
|
||
# 模拟宿主 ViewDesign 的 FindEigen3:普通(非 IMPORTED)INTERFACE target
|
||
find_path(EIGEN3_INCLUDE_DIR Eigen/Core
|
||
HINTS /usr/include/eigen3 /usr/local/include/eigen3)
|
||
if(NOT EIGEN3_INCLUDE_DIR)
|
||
message(FATAL_ERROR "host FindEigen3: Eigen/Core not found")
|
||
endif()
|
||
add_library(_vd_eigen3 INTERFACE)
|
||
target_include_directories(_vd_eigen3 INTERFACE ${EIGEN3_INCLUDE_DIR})
|
||
add_library(Eigen3::Eigen ALIAS _vd_eigen3)
|
||
set(Eigen3_FOUND TRUE)
|
||
EOF
|
||
|
||
cat > "$RUNNER_TEMP/embed-host/CMakeLists.txt" <<'EOF'
|
||
cmake_minimum_required(VERSION 3.20)
|
||
project(VdeEmbedHost CXX)
|
||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||
set(CMAKE_CXX_STANDARD 20)
|
||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||
add_subdirectory("${VDE_SOURCE_DIR}" vde)
|
||
add_executable(host_embed main.cpp)
|
||
target_link_libraries(host_embed PRIVATE vde::kernel)
|
||
install(TARGETS host_embed RUNTIME DESTINATION bin)
|
||
EOF
|
||
|
||
cat > "$RUNNER_TEMP/embed-host/main.cpp" <<'EOF'
|
||
#include "vde/brep/brep.h"
|
||
#include "vde/brep/modeling.h"
|
||
#include <cstdio>
|
||
int main() {
|
||
const auto box = vde::brep::make_box(2.0, 3.0, 4.0);
|
||
const bool ok = box.num_faces() == 6 && box.body_volume() > 0.0;
|
||
std::printf("EMBED_CONSUMER_%s faces=%zu\n", ok ? "PASS" : "FAIL",
|
||
box.num_faces());
|
||
return ok ? 0 : 1;
|
||
}
|
||
EOF
|
||
|
||
- name: 配置/构建/安装(VDE_INSTALL=ON,kernel SDK 导出回归)
|
||
env:
|
||
CC: gcc-11
|
||
CXX: g++-11
|
||
run: |
|
||
cmake -S "$RUNNER_TEMP/embed-host" -B "$RUNNER_TEMP/build-on" -G Ninja \
|
||
-DCMAKE_BUILD_TYPE=Release \
|
||
-DVDE_SOURCE_DIR="$GITHUB_WORKSPACE" \
|
||
-DVDE_INSTALL=ON -DVDE_INSTALL_SDK=ON \
|
||
-DBUILD_TESTS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_BENCHMARKS=OFF \
|
||
-DVDE_BUILD_TOOLS=OFF -DVDE_BUILD_SAMPLE_PLUGINS=OFF \
|
||
2>&1 | tee "$RUNNER_TEMP/configure-on.log"
|
||
# VDE_INSTALL=ON 时 install 规则覆盖 kernel SDK 全量库;先构建全部 VDE 目标
|
||
cmake --build "$RUNNER_TEMP/build-on" --parallel $(nproc)
|
||
"$RUNNER_TEMP/build-on/host_embed"
|
||
cmake --install "$RUNNER_TEMP/build-on" --prefix "$RUNNER_TEMP/embed-install-on"
|
||
test -f "$RUNNER_TEMP/embed-install-on/bin/host_embed"
|
||
test -f "$RUNNER_TEMP/embed-install-on/lib/cmake/vde-kernel/vde-kernelConfig.cmake"
|
||
|
||
- name: 配置/构建(VDE_INSTALL=OFF,宿主保留自身 install 规则)
|
||
env:
|
||
CC: gcc-11
|
||
CXX: g++-11
|
||
run: |
|
||
cmake -S "$RUNNER_TEMP/embed-host" -B "$RUNNER_TEMP/build-off" -G Ninja \
|
||
-DCMAKE_BUILD_TYPE=Release \
|
||
-DVDE_SOURCE_DIR="$GITHUB_WORKSPACE" \
|
||
-DVDE_INSTALL=OFF -DVDE_INSTALL_SDK=ON \
|
||
-DBUILD_TESTS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_BENCHMARKS=OFF \
|
||
-DVDE_BUILD_TOOLS=OFF -DVDE_BUILD_SAMPLE_PLUGINS=OFF \
|
||
2>&1 | tee "$RUNNER_TEMP/configure-off.log"
|
||
grep -q "VDE-1251: VDE_INSTALL=OFF" "$RUNNER_TEMP/configure-off.log"
|
||
cmake --build "$RUNNER_TEMP/build-off" --target host_embed --parallel $(nproc)
|
||
"$RUNNER_TEMP/build-off/host_embed"
|
||
cmake --install "$RUNNER_TEMP/build-off" --prefix "$RUNNER_TEMP/embed-install-off"
|
||
test -f "$RUNNER_TEMP/embed-install-off/bin/host_embed"
|
||
test ! -e "$RUNNER_TEMP/embed-install-off/lib/cmake/vde-kernel"
|
||
test ! -e "$RUNNER_TEMP/embed-install-off/lib/libvde_brep.a"
|
||
|
||
|
||
# ── P4:模块包 CI 矩阵(configure/build/install + find_package consumers)──
|
||
# 覆盖 kernel/render/drafting/mechanism/ui/pdm/cam/cae/assembly/sheetmetal:
|
||
# cmake/check_module_packages.cmake 配置 VDE(VDE_INSTALL=ON + VDE_INSTALL_SDK=ON)、
|
||
# 构建、安装到临时 prefix,随后对每个 vde-<module> 用 find_package 配置
|
||
# tests/module_packages/consumers/<module> 最小工程并构建/运行 smoke。
|
||
# 模块包未安装时 SKIP(支持 VDE_BUILD_<MODULE>=OFF 的增量接入);任意 FAIL → job 失败。
|
||
module-packages:
|
||
name: Ubuntu 22.04 • Module packages matrix (find_package consumers)
|
||
runs-on: ubuntu-22.04
|
||
timeout-minutes: 60
|
||
|
||
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: 模块包矩阵(configure/build/install + 10 个 consumer)
|
||
env:
|
||
CC: gcc-11
|
||
CXX: g++-11
|
||
run: |
|
||
cmake -DSOURCE_DIR="$GITHUB_WORKSPACE" \
|
||
-DBUILD_ROOT="$RUNNER_TEMP/module-packages" \
|
||
-DINSTALL_PREFIX="$RUNNER_TEMP/module-packages/install" \
|
||
-DGENERATOR=Ninja \
|
||
-DCMAKE_BUILD_TYPE=Release \
|
||
-DBUILD_JOBS=$(nproc) \
|
||
-P "$GITHUB_WORKSPACE/cmake/check_module_packages.cmake"
|
||
|
||
- name: 上传日志
|
||
if: always()
|
||
uses: actions/upload-artifact@v4
|
||
with:
|
||
name: module-packages-logs
|
||
path: ${{ runner.temp }}/module-packages/logs
|