Skip to main content

Crate sykli

Crate sykli 

Source
Expand description

Sykli - CI pipelines defined in Rust instead of YAML

§Simple usage

use sykli::Pipeline;

let mut p = Pipeline::new();
p.task("test").run("cargo test");
p.task("build").run("cargo build --release").after(&["test"]);
p.emit();

§With containers and caching

use sykli::Pipeline;

let mut p = Pipeline::new();
let src = p.dir(".");
let cache = p.cache("cargo-registry");

p.task("test")
    .container("rust:1.75")
    .mount(&src, "/src")
    .mount_cache(&cache, "/usr/local/cargo/registry")
    .workdir("/src")
    .run("cargo test");

p.emit();

§Custom Targets

For implementing custom execution targets, see the target module.

use sykli::target::{Target, TaskSpec, Result};

struct MyTarget;

impl Target for MyTarget {
    fn run_task(&self, task: &TaskSpec) -> Result {
        // Execute tasks your way
        Result::success()
    }
}

Modules§

target
Target interface - where pipelines execute.

Structs§

CacheVolume
A named cache volume that persists between runs.
Condition
A type-safe condition for when a task should run.
Directory
A directory resource that can be mounted into containers.
ExplainContext
Context for evaluating conditions during explain/dry-run.
K8sOptions
Kubernetes-specific configuration for a task.
K8sValidationError
Error from K8s options validation.
Pipeline
A CI pipeline with tasks and resources.
RustPreset
Convenience methods for Rust projects.
SecretRef
A typed reference to a secret with its source.
Task
A task in the pipeline.
TaskGroup
A group of tasks that can be used as a dependency. Created by matrix() and can be passed to after() or chain().
Template
A reusable task configuration template.

Enums§

Criticality
Task criticality for AI prioritization.
OnFailAction
What AI should do when a task fails.
SecretSource
Source of a secret value.
SelectMode
How AI should select this task for execution.