From c893dc90053d8faf9f242d950cb72274bdcd4bf4 Mon Sep 17 00:00:00 2001 From: kjuulh Date: Mon, 27 Nov 2023 20:31:29 +0100 Subject: [PATCH] feat: with before test Signed-off-by: kjuulh --- crates/cuddle-ci/src/rust_service.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/crates/cuddle-ci/src/rust_service.rs b/crates/cuddle-ci/src/rust_service.rs index b858e29..2f62e98 100644 --- a/crates/cuddle-ci/src/rust_service.rs +++ b/crates/cuddle-ci/src/rust_service.rs @@ -296,6 +296,16 @@ impl RustService { pub async fn build_test(&self) -> eyre::Result<()> { let base = self.build_base().await?; + let before_build = self + .stages + .iter() + .filter_map(|s| match s { + RustServiceStage::BeforeBuild(m) => Some(m), + _ => None, + }) + .collect::>(); + let base = self.run_stage(before_build, base).await?; + base.with_exec(vec!["cargo", "test", "--release"]) .sync() .await?;