diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-08-18 11:09:23 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-08-18 11:09:23 +0800 |
| commit | b1102be2682feb2d2182ead0fcc7ce12f8d0c865 (patch) | |
| tree | 6bb68f2a79600aa1144d05394b89de9286d385c9 /mingling_ci/src/task/cmd_docs_check.rs | |
| parent | 65464029958facf58c886a3ab5d4b9ab176f4e1c (diff) | |
refactor(mingling_ci): rename build, clippy, and docs commands to -check
suffix
Diffstat (limited to 'mingling_ci/src/task/cmd_docs_check.rs')
| -rw-r--r-- | mingling_ci/src/task/cmd_docs_check.rs | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/mingling_ci/src/task/cmd_docs_check.rs b/mingling_ci/src/task/cmd_docs_check.rs new file mode 100644 index 0000000..3a77d4d --- /dev/null +++ b/mingling_ci/src/task/cmd_docs_check.rs @@ -0,0 +1,44 @@ +use std::ffi::OsString; + +use mingling::{ + Grouped, Routable, + macros::{buffer, command, renderer}, + res::ResExitCode, +}; + +use crate::Next; +use crate::res::ResFeatureList; +use crate::task::run::run_parallel_checks; + +#[command(node = "docs-check")] +pub async fn docs_check(features: &ResFeatureList) -> Next { + let args = vec![ + OsString::from("cargo"), + OsString::from("rustdoc"), + OsString::from("--features"), + OsString::from(features.list.join(",")), + OsString::from("-p"), + OsString::from("mingling"), + OsString::from("--"), + OsString::from("-D"), + OsString::from("warnings"), + ]; + let tasks = vec![("mingling".to_string(), "./mingling".to_string(), args)]; + let fail_count = run_parallel_checks("Docs-Check", "Docs", tasks).await; + + ResultDocsCheck { fail_count }.to_chain() +} + +/// Number of failed doc builds (0 or 1). +#[derive(Grouped)] +pub struct ResultDocsCheck { + pub fail_count: usize, +} + +/// Silently sets a non-zero exit code when the doc build failed. +#[renderer(buffer)] +pub fn render_docs_check(r: ResultDocsCheck, exit_code: &mut ResExitCode) { + if r.fail_count > 0 { + exit_code.exit_code = 1; + } +} |
