ptest: Add workflow argument

Allow the `--workflow` argument to override the workflow file that is used, with
a reasonable default of the workflow used by CI.

Signed-off-by: David Brown <david.brown@linaro.org>
This commit is contained in:
David Brown 2024-04-11 09:31:26 -06:00 committed by David Brown
parent 8798337940
commit c32ad20fae
1 changed files with 5 additions and 1 deletions

View File

@ -44,7 +44,7 @@ fn main() -> Result<()> {
Commands::Run => (), Commands::Run => (),
} }
let workflow_text = fs::read_to_string("../.github/workflows/sim.yaml")?; let workflow_text = fs::read_to_string(&args.workflow)?;
let workflow = YamlLoader::load_from_str(&workflow_text)?; let workflow = YamlLoader::load_from_str(&workflow_text)?;
let ncpus = num_cpus::get(); let ncpus = num_cpus::get();
@ -88,6 +88,10 @@ fn main() -> Result<()> {
#[command(name = "ptest")] #[command(name = "ptest")]
#[command(about = "Run MCUboot CI tests stand alone")] #[command(about = "Run MCUboot CI tests stand alone")]
struct Cli { struct Cli {
/// The workflow file to use.
#[arg(short, long, default_value = "../.github/workflows/sim.yaml")]
workflow: String,
#[command(subcommand)] #[command(subcommand)]
command: Commands, command: Commands,
} }