Examples
A Cargo project: build, test, clippy, and fmt fork from one toolchain install.
A Cargo project: build, test, clippy, and fmt fork from one toolchain install.
Project layout
Cargo.lock
Cargo.toml
README.md
Pipeline
"""Rust example pipeline — the one-call CI DAG."""from __future__ import annotationsimport harmont as hmfrom harmont._rust import RustProject@hm.target()def project() -> RustProject: # project() warms a shared dependency cache keyed on Cargo.lock + sources, # so test/clippy/fmt reuse one compile. return hm.rust.project(path=".")@hm.pipeline( "ci", env={"CI": "true", "RUST_BACKTRACE": "1"}, triggers=[hm.push(branch="main")],)def ci(project: hm.Target[RustProject]) -> tuple[hm.Step, ...]: # ci() is the zero-config DAG: test + clippy + fmt, all sharing one warmup. # Pass nextest=True if cargo-nextest is available to also split out doctests. return project.ci()import { pipeline, push, type PipelineDefinition } from "@harmont/hm";import { rust } from "@harmont/hm/toolchains";// project() warms a shared dependency cache so test/clippy/fmt reuse one compile.const project = rust.project({ path: "." });const pipelines: PipelineDefinition[] = [ { slug: "ci", triggers: [push({ branch: "main" })], // ci() → test + clippy + fmt, sharing one warmup. Add { nextest: true } // when cargo-nextest is available to also split out doctests. pipeline: pipeline(project.ci(), { env: { CI: "true", RUST_BACKTRACE: "1" }, defaultImage: "ubuntu:24.04", }), },];export default pipelines;Run it
hm run ci