Skip to content

Commit c32ad20

Browse files
committed
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 <[email protected]>
1 parent 8798337 commit c32ad20

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ptest/src/main.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ fn main() -> Result<()> {
4444
Commands::Run => (),
4545
}
4646

47-
let workflow_text = fs::read_to_string("../.github/workflows/sim.yaml")?;
47+
let workflow_text = fs::read_to_string(&args.workflow)?;
4848
let workflow = YamlLoader::load_from_str(&workflow_text)?;
4949

5050
let ncpus = num_cpus::get();
@@ -88,6 +88,10 @@ fn main() -> Result<()> {
8888
#[command(name = "ptest")]
8989
#[command(about = "Run MCUboot CI tests stand alone")]
9090
struct Cli {
91+
/// The workflow file to use.
92+
#[arg(short, long, default_value = "../.github/workflows/sim.yaml")]
93+
workflow: String,
94+
9195
#[command(subcommand)]
9296
command: Commands,
9397
}

0 commit comments

Comments
 (0)