flowey_lib_hvlite/_jobs/
build_test_results_website.rs1use flowey::node::prelude::*;
7
8flowey_request! {
9 pub struct Request {
10 pub path: WriteVar<PathBuf>,
11 }
12}
13
14new_simple_flow_node!(struct Node);
15
16impl SimpleFlowNode for Node {
17 type Request = Request;
18
19 fn imports(ctx: &mut ImportCtx<'_>) {
20 ctx.import::<crate::git_checkout_openvmm_repo::Node>();
21 ctx.import::<flowey_lib_common::install_nodejs::Node>();
22 }
23
24 fn process_request(request: Self::Request, ctx: &mut NodeCtx<'_>) -> anyhow::Result<()> {
25 let Request { path } = request;
26
27 let npm_installed = ctx.reqv(flowey_lib_common::install_nodejs::Request::EnsureInstalled);
29 let openvmm_repo_path = ctx.reqv(crate::git_checkout_openvmm_repo::req::GetRepoDir);
30
31 ctx.emit_rust_step("build test-results website", |ctx| {
32 npm_installed.claim(ctx);
33 let path = path.claim(ctx);
34 let openvmm_repo_path = openvmm_repo_path.claim(ctx);
35
36 move |rt| {
37 let sh = xshell::Shell::new()?;
38 let mut dist_path = rt.read(openvmm_repo_path);
39
40 dist_path.push("petri");
43 dist_path.push("logview_new");
44
45 sh.change_dir(&dist_path);
46
47 xshell::cmd!(sh, "npm install").run()?;
50 xshell::cmd!(sh, "npm run build:ci").run()?;
51
52 dist_path.push("dist-ci");
53 if !dist_path.exists() {
54 anyhow::bail!(
55 "logview_new build failed. Expected 'dist-ci' directory at {:?} but it was not found.",
56 dist_path
57 );
58 }
59
60 rt.write(path, &dist_path);
61
62 Ok(())
63 }
64 });
65
66 Ok(())
67 }
68}