# tangled-workflow A Rust eDSL for defining [Tangled](https://tangled.org) [workflows](https://docs.tangled.org/spindles). ## Usage ```rust use tangled_workflow::{Constraint, Event, Microvm, Step, Workflow}; let workflow = Workflow::new( Microvm::new() .image("nixos") .dependencies(["cargo", "rustc", "clippy"]), ) .when(Constraint::event([Event::Push, Event::PullRequest]).branch(["main"])) .step(Step::run("Clippy", "cargo clippy --all-targets -- -D warnings")) .step(Step::run("Test", "cargo test --all")); println!("{}", workflow.to_yaml()?); ``` This emits YAML suitable for `.tangled/workflows/`: ```yaml when: - event: - push - pull_request branch: - main engine: microvm image: nixos dependencies: - cargo - rustc - clippy steps: - name: Clippy command: cargo clippy --all-targets -- -D warnings - name: Test command: cargo test --all ```