Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
bevyengine
GitHub Repository: bevyengine/bevy
Path: blob/main/tools/ci/src/args.rs
6596 views
1
use crate::CI;
2
3
/// Arguments that are available to CI commands.
4
#[derive(Copy, Clone, PartialEq, Eq)]
5
pub struct Args {
6
keep_going: bool,
7
test_threads: Option<usize>,
8
build_jobs: Option<usize>,
9
}
10
11
impl Args {
12
#[inline(always)]
13
pub fn keep_going(&self) -> Option<&'static str> {
14
self.keep_going.then_some("--no-fail-fast")
15
}
16
17
#[inline(always)]
18
pub fn build_jobs(&self) -> Option<String> {
19
self.build_jobs.map(|jobs| format!("--jobs={jobs}"))
20
}
21
22
#[inline(always)]
23
pub fn test_threads(&self) -> Option<String> {
24
self.test_threads
25
.map(|threads| format!("--test-threads={threads}"))
26
}
27
}
28
29
impl From<&CI> for Args {
30
fn from(value: &CI) -> Self {
31
Args {
32
keep_going: value.keep_going,
33
test_threads: value.test_threads,
34
build_jobs: value.build_jobs,
35
}
36
}
37
}
38
39