pub struct CiWorkflow { /* private fields */ }Expand description
A workflow under construction. See the module docs for the shape.
Implementations§
Source§impl CiWorkflow
impl CiWorkflow
Sourcepub fn engine(self, engine: impl Into<String>) -> Self
pub fn engine(self, engine: impl Into<String>) -> Self
Override the engine (nixery by default).
Sourcepub fn on_pull_request<I, S>(self, branches: I) -> Self
pub fn on_pull_request<I, S>(self, branches: I) -> Self
Add a pull_request trigger targeting the given branches.
Sourcepub fn deps<I, S>(self, packages: I) -> Self
pub fn deps<I, S>(self, packages: I) -> Self
Add nixpkgs dependencies — the toolchain the steps run against.
Sourcepub fn deps_from<I, S>(self, registry: impl Into<String>, packages: I) -> Self
pub fn deps_from<I, S>(self, registry: impl Into<String>, packages: I) -> Self
Add dependencies from a custom registry (a flake reference).
Sourcepub fn env(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn env(self, key: impl Into<String>, value: impl Into<String>) -> Self
Set a workflow-level environment variable.
Sourcepub fn step(self, name: impl Into<String>, command: impl Into<String>) -> Self
pub fn step(self, name: impl Into<String>, command: impl Into<String>) -> Self
Append a step. Steps run serially, in one VM, from the workspace root.
Sourcepub fn step_env(
self,
name: impl Into<String>,
command: impl Into<String>,
env: impl IntoIterator<Item = (String, String)>,
) -> Self
pub fn step_env( self, name: impl Into<String>, command: impl Into<String>, env: impl IntoIterator<Item = (String, String)>, ) -> Self
Append a step with step-scoped environment variables.
Sourcepub fn clone_depth(self, depth: u32) -> Self
pub fn clone_depth(self, depth: u32) -> Self
Set the clone depth (default 1).
Sourcepub fn skip_clone(self) -> Self
pub fn skip_clone(self) -> Self
Skip the checkout entirely.
Sourcepub fn file_name(&self) -> String
pub fn file_name(&self) -> String
The file name CiWorkflow::save writes: <name>.yml.
Sourcepub fn yaml(&self) -> String
pub fn yaml(&self) -> String
Render the workflow file.
Scalars are emitted as JSON strings — valid YAML by construction — and commands as literal blocks when safe, so the SDK needs no YAML dependency.
Sourcepub fn save(&self, repo: impl AsRef<Path>) -> Result<PathBuf>
pub fn save(&self, repo: impl AsRef<Path>) -> Result<PathBuf>
Write the workflow into <repo>/.tangled/workflows/, where spindle
and bsdkrun ci both discover it. Returns the path.
Trait Implementations§
Source§impl Clone for CiWorkflow
impl Clone for CiWorkflow
Source§fn clone(&self) -> CiWorkflow
fn clone(&self) -> CiWorkflow
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more