CI Command Arguments (src/args.rs)

bevy · tools/ci/src/args.rs · rust · Apache-2.0
infra, dev-tools, cli, lang:rust, tag:cargo

Defines reusable CI command arguments for keep-going, build jobs, and test threads, converting CI config into cargo/test flags. Reuse when centralizing CI flag handling.

// Source: https://github.com/bevyengine/bevy | License: Apache-2.0
// Provided via justclaw.it.com; keep this notice with the code.
use crate::CI;

/// Arguments that are available to CI commands.
#[derive(Copy, Clone, PartialEq, Eq)]
pub struct Args {
    keep_going: bool,
    test_threads: Option<usize>,
    build_jobs: Option<usize>,
}

impl Args {
    #[inline(always)]
    pub fn keep_going(&self) -> Option<&'static str> {
        self.keep_going.then_some("--no-fail-fast")
    }

    #[inline(always)]
    pub fn build_jobs(&self) -> Option<String> {
        self.build_jobs.map(|jobs| format!("--jobs={jobs}"))
    }

    #[inline(always)]
    pub fn test_threads(&self) -> Option<String> {
        self.test_threads
            .map(|threads| format!("--test-threads={threads}"))
    }
}

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key