mirror of
https://github.com/enso-org/enso.git
synced 2024-12-23 21:12:44 +03:00
Run benchmarks after building stuff. (#6685)
As discussed in https://discord.com/channels/401396655599124480/1106814204175978516
This commit is contained in:
parent
067ed0cb21
commit
70cdb15d02
@ -322,10 +322,14 @@ impl RunContext {
|
||||
]);
|
||||
}
|
||||
|
||||
tasks.extend(self.config.execute_benchmarks.iter().flat_map(|b| b.sbt_task()));
|
||||
if !tasks.is_empty() {
|
||||
let build_stuff = Sbt::concurrent_tasks(tasks);
|
||||
sbt.call_arg(build_stuff).await?;
|
||||
// We want benchmarks to run only after the other build tasks are done, as they are
|
||||
// really CPU-heavy.
|
||||
let build_command = (!tasks.is_empty()).then_some(Sbt::concurrent_tasks(tasks));
|
||||
let benchmark_tasks = self.config.execute_benchmarks.iter().flat_map(|b| b.sbt_task());
|
||||
let command_sequence = build_command.as_deref().into_iter().chain(benchmark_tasks);
|
||||
let final_command = Sbt::sequential_tasks(command_sequence);
|
||||
if !final_command.is_empty() {
|
||||
sbt.call_arg(final_command).await?;
|
||||
} else {
|
||||
debug!("No SBT tasks to run.");
|
||||
}
|
||||
|
@ -41,6 +41,11 @@ impl Sbt {
|
||||
}
|
||||
ret
|
||||
}
|
||||
|
||||
/// Format a string with a command that will execute all the given tasks sequentially.
|
||||
pub fn sequential_tasks<'a>(tasks: impl IntoIterator<Item = &'a str>) -> String {
|
||||
tasks.into_iter().collect::<Vec<_>>().join("; ")
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
|
Loading…
Reference in New Issue
Block a user