microsoft/openvmm

Public

mirrored fromhttps://github.com/microsoft/openvmmAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
9fa0c3ee87af75e07fa974b6005348ae6b9349ff

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

flowey/flowey_hvlite/src/pipelines/mod.rs

67lines · modecode

1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
4use flowey::pipeline::prelude::*;
5use restore_packages::RestorePackagesCli;
6
7pub mod build_igvm;
8pub mod checkin_gates;
9pub mod custom_vmfirmwareigvm_dll;
10pub mod restore_packages;
11
12#[derive(clap::Subcommand)]
13#[expect(clippy::large_enum_variant)]
14pub enum OpenvmmPipelines {
15 /// Alias for root-level `regen` command.
16 // DEVNOTE: this enables the useful `cargo xflowey regen` alias
17 Regen {
18 #[arg(trailing_var_arg = true, allow_hyphen_values = true, hide = true)]
19 args: Vec<String>,
20 },
21
22 BuildIgvm(build_igvm::BuildIgvmCli),
23 CustomVmfirmwareigvmDll(custom_vmfirmwareigvm_dll::CustomVmfirmwareigvmDllCli),
24
25 /// Flowey pipelines primarily designed to run in CI.
26 #[clap(subcommand)]
27 Ci(OpenvmmPipelinesCi),
28
29 /// Install tools needed to build OpenVMM
30 RestorePackages(RestorePackagesCli),
31}
32
33#[derive(clap::Subcommand)]
34pub enum OpenvmmPipelinesCi {
35 CheckinGates(checkin_gates::CheckinGatesCli),
36}
37
38impl IntoPipeline for OpenvmmPipelines {
39 fn into_pipeline(self, pipeline_hint: PipelineBackendHint) -> anyhow::Result<Pipeline> {
40 match self {
41 OpenvmmPipelines::Regen { args } => {
42 std::process::Command::new("cargo")
43 .args([
44 "run",
45 "-p",
46 "flowey_hvlite",
47 "--profile",
48 "flowey",
49 "--",
50 "regen",
51 ])
52 .args(args)
53 .spawn()?
54 .wait()?;
55 std::process::exit(0)
56 }
57
58 OpenvmmPipelines::BuildIgvm(cmd) => cmd.into_pipeline(pipeline_hint),
59 OpenvmmPipelines::CustomVmfirmwareigvmDll(cmd) => cmd.into_pipeline(pipeline_hint),
60
61 OpenvmmPipelines::Ci(cmd) => match cmd {
62 OpenvmmPipelinesCi::CheckinGates(cmd) => cmd.into_pipeline(pipeline_hint),
63 },
64 OpenvmmPipelines::RestorePackages(cmd) => cmd.into_pipeline(pipeline_hint),
65 }
66 }
67}
68