repolith_actions/lib.rs
1//! Concrete [`Action`](repolith_core::action::Action) implementations
2//! for repolith.
3//!
4//! Each backend lives behind its own cargo feature so consumers only
5//! pull the dependencies they actually need:
6//!
7//! | Feature | Module | What it does |
8//! |----------|---------------------------------|------------------------------------------------------|
9//! | `git` | [`git_clone::GitClone`] | shells out to `git clone` / `git fetch` |
10//! | `cargo` | [`cargo_install::CargoInstall`] | shells out to `cargo install --bin <name> --locked` |
11//! | `docker` | [`docker::DockerBuild`] | shells out to `docker build -f … -t … -- <context>` |
12//!
13//! Every action shells out to an external CLI rather than linking the
14//! corresponding library (no `git2`, no `cargo` as a crate). Two reasons:
15//! faster compile times, and the host already has the CLIs by hypothesis
16//! (you can't run `repolith sync` without `git` and `cargo` on `PATH`).
17//!
18//! Every spawned subprocess is raced against `ctx.cancel` via the
19//! shared `util::run_with_cancel` helper so the orchestrator's
20//! `FailFast` mode can short-circuit a long-running clone or build.
21//! New actions that shell out should go through the same helper.
22//!
23//! See [`CONTRIBUTING.md`](https://github.com/anatta-rs/repolith/blob/main/CONTRIBUTING.md)
24//! for the recipe to add a new action.
25
26#[cfg(any(feature = "git", feature = "cargo", feature = "docker"))]
27pub(crate) mod util;
28
29/// Path utilities (tilde expansion). Public so the manifest factory in the
30/// CLI can apply the same expansion to `node.path` that `cargo_install`
31/// already applies to `install_to`.
32pub mod paths;
33
34/// `GitClone` action — mirror a remote git repository into a local path.
35#[cfg(feature = "git")]
36pub mod git_clone;
37
38/// `CargoInstall` action — `cargo install` a binary crate from git or path.
39#[cfg(feature = "cargo")]
40pub mod cargo_install;
41
42/// `DockerBuild` action — `docker build` an image from the node's checkout.
43#[cfg(feature = "docker")]
44pub mod docker;