SuperAPI AI 工具集

rust-tooling-cicd

编程与开发

查看项目

更新于 10-15 21:48

技能介绍

用途:帮助组织 Cargo 工作区结构并构建 Rust CI 流水线,覆盖格式检查、静态检查、供应链审计、测试、覆盖率与最低支持 Rust 版本(MSRV)。不适用于编写单元/集成/proptest/criterion 测试(属于 rust-testing-quality),也不覆盖非 Rust 的 CI 流水线。

主要能力:按固定顺序执行门禁——fmt → clippy → deny → audit → nextest → test --doc → coverage,让廉价且快速失败的检查先跑;在 CI 中对 clippy 使用 -D warnings,使警告直接导致构建失败;提交 deny.toml 作为供应链策略即代码;在 [workspace.dependencies] 集中管理依赖版本,成员用 dep.workspace = true 继承,避免同一 crate 重复固定版本;cargo test --doc 作为独立步骤,因为 nextest 不运行文档测试。还涉及 cargo hack 的 feature-powerset 检查与 cargo machete 的未使用依赖清理。

使用方式:本地完整门禁命令为 cargo fmt --all -- --check、cargo clippy --all-targets --all-features -- -D warnings、cargo deny check、cargo audit、cargo nextest run --all-features、cargo test --doc、cargo llvm-cov --all-features --workspace。工作区依赖继承示例:根 Cargo.toml 写 [workspace.dependencies] serde = { version = "1", features = ["derive"] },成员 Cargo.toml 写 [dependencies] serde = { workspace = true }。

适用场景:需要统一工作区布局、单一 Cargo.lock 与 target/、共享元数据、功能特性设计、MSRV 矩阵、GitHub Actions 流水线以及供应链策略审查的 Rust 项目。

限制:资料未提供具体收费、价格、平台支持范围或效果数据;部分细节需参考其 ci-workflow.md、deny-toml.md、workspaces-features.md、ci-gate.md 等文档。