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
19 changes: 7 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,16 +196,10 @@ jobs:
key: short-fuzz-${{ matrix.target }}

- name: 安装 cargo-fuzz
uses: taiki-e/install-action@v2
with:
tool: cargo-fuzz
continue-on-error: true

- name: Fallback 安装 cargo-fuzz
run: |
if ! cargo fuzz --version 2>/dev/null; then
cargo install cargo-fuzz --locked
fi
# install-action 会回退到 musl 预编译包,使 cargo-fuzz 错把 CI 主机识别为
# x86_64-unknown-linux-musl;ASan 与静态 musl 不兼容,因此从源码为实际
# x86_64-unknown-linux-gnu 主机安装。
run: cargo install cargo-fuzz --locked

- name: 运行短时模糊测试 (${{ matrix.target }})
run: |
Expand Down Expand Up @@ -293,8 +287,9 @@ jobs:
# (重型 benchmark 会导致 CI 超时且不贡献库覆盖率)
# --exclude triviumdb-cli: CLI/TUI 工具是独立交付物,不计入核心库 80% 门禁
cargo llvm-cov --workspace --exclude triviumdb-cli --lib --tests --lcov --output-path lcov.info --fail-under-lines 80 -- --test-threads=1
cargo llvm-cov report --workspace --exclude triviumdb-cli --html --output-dir target/llvm-cov/html
cargo llvm-cov report --workspace --exclude triviumdb-cli
# report 子命令复用上一步已收集的覆盖率数据,不接受 workspace package 选择参数。
cargo llvm-cov report --html --output-dir target/llvm-cov/html
cargo llvm-cov report

- name: 上传覆盖率报告
uses: actions/upload-artifact@v4
Expand Down
3 changes: 3 additions & 0 deletions fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ doc = false
name = "fuzz_filter_parse"
path = "fuzz_targets/fuzz_filter_parse.rs"
doc = false

# cargo-fuzz 作为独立 workspace 构建,避免被父级 workspace 发现后拒绝运行。
[workspace]
Loading
Loading