What it does
dev-ci generates calibrated CI workflow files (currently GitHub
Actions; other platforms in the roadmap) from a structured Rust API
plus a CLI front-end. One source of truth, byte-deterministic output,
every checkout pinned at actions/checkout@v5.
The runtime side — a GitHub Action that runs the entire dev-*
verification collection end-to-end inside one job and uploads SARIF —
lands later in the 0.9.x line.
Quick start (CLI)
Writes .github/workflows/ci.yml. Pass --print to send the result
to stdout instead.
Quick start (Library)
[]
= "0.9"
use ;
let yaml = new
.target
.matrix_os
.with_clippy
.with_fmt
.with_docs
.with_msrv
.generate;
write.unwrap;
Builder surface
| Method | What it does |
|---|---|
target(Target) |
Pick the output platform. Default: GitHubActions. |
workflow_name(s) |
Set the name: field. Default: "CI". |
branches(iter) |
Branch filter for both push and pull_request. Default: ["main"]. |
matrix_os(iter) |
OS list for the test matrix. Default: ["ubuntu-latest"]. |
with_cache(bool) |
Toggle Swatinem/rust-cache@v2. Default: enabled. |
with_workspace() |
Pass --workspace to every cargo call. |
features(list) |
Pass --features <list> to default build/test steps. |
with_no_default_features_build() |
Add a cargo build --no-default-features step. |
with_all_features_build() |
Add cargo build --all-features + cargo test --all-features. |
with_path_dep(PathDep) |
Declare a sibling path-dep to git clone before cargo runs. |
with_clippy() |
Add a clippy job (all-features + no-default-features lint runs). |
with_fmt() |
Add a fmt job (cargo fmt --all -- --check). |
with_docs() |
Add a docs job with RUSTDOCFLAGS="-D warnings". |
with_msrv(version) |
Add an msrv job pinning dtolnay/rust-toolchain@<version>. |
Sibling path-deps
For the dev-* suite itself (and any other multi-crate-repo project)
each crate's CI clones its siblings into .. before running cargo:
use ;
let yaml = new
.with_path_dep
.with_path_dep
.generate;
assert!;
The clones land in a single run: | step right after
actions/checkout, before the toolchain install.
Determinism
A given Generator configuration produces byte-identical YAML across
runs and machines — no clock reads, no random IDs, list iteration is
in insertion order. Two calls to generate() on the same Generator
return equal strings.
This makes the generated YAML safe to diff during code review and safe to assert against in unit tests.
CLI
dev-ci ships a CLI binary as well as the library. Install it once:
Then dev-ci --help prints the full reference; the patterns below
cover the common use cases.
Install
One-shot, accept the defaults
Writes .github/workflows/ci.yml with: actions/checkout@v5, a
single test job on ubuntu-latest, cargo build, cargo test,
and the Swatinem/rust-cache@v2 action enabled.
Multi-OS matrix with the standard quality jobs
You get test (3 OSes) plus clippy, fmt, docs, and msrv as
their own jobs.
Crate that uses path-deps to sibling repos
Each --path-dep adds a git clone --depth 1 step that runs before
cargo, dropping the sibling into .. so the path-dep resolves.
Preview without writing
Pipe into kdiff3, delta, or your editor when you're not ready to
overwrite the existing workflow.
Custom output path or workflow name
Workspace project
Adds --workspace to every cargo call in the workflow.
Restrict trigger branches
Both push and pull_request are filtered to the matching branches.
Disable the cache action
Omits the Swatinem/rust-cache@v2 step. Use when the cache layer
itself is what you're trying to debug.
Flag reference
| Flag | Equivalent builder method |
|---|---|
--target github-actions |
target(Target::GitHubActions) (default) |
--workflow-name <NAME> |
workflow_name(NAME) |
--branches main,release/* |
branches([...]) |
--matrix ubuntu-latest,macos-latest |
matrix_os([...]) |
--with clippy,fmt,docs,msrv |
with_clippy() / with_fmt() / with_docs() / with_msrv(...) |
--msrv 1.85 |
with_msrv("1.85") |
--features foo,bar |
features("foo,bar") |
--no-default-features-build |
with_no_default_features_build() |
--all-features-build |
with_all_features_build() |
--workspace |
with_workspace() |
--no-cache |
with_cache(false) |
--path-dep name=url |
with_path_dep(PathDep::new(name, url)) |
--output <PATH> / --print |
Write to file (default .github/workflows/ci.yml) or stdout. |
Exit codes
| Code | Meaning |
|---|---|
0 |
Workflow generated and written successfully. |
1 |
Bad arguments, unknown job in --with, or I/O error writing the output file. The reason is printed to stderr. |
Combine with --print for review workflows
The CLI is deterministic, so it composes well with code review:
# Diff against what's checked in
|
# Apply only if the diff looks right
Examples
| File | What it shows |
|---|---|
examples/basic.rs |
Minimal workflow — single-OS test + clippy + fmt + docs + msrv. |
examples/full_suite.rs |
3-OS matrix, every job, workspace + all-features + no-default builds. |
examples/path_deps.rs |
The sibling-clone pattern the dev-* suite itself uses. |
examples/write_to_disk.rs |
Generate and write the workflow to a file. |
The dev-* collection
dev-ci ships independently and is also re-exported by the
dev-tools umbrella crate as
the ci feature. Sister crates cover the other verification
dimensions:
dev-report— report schema everything emitsdev-fixtures— deterministic test fixturesdev-bench— performance and regression detectiondev-async— async runtime verificationdev-stress— stress and soak workloadsdev-chaos— fault injection and recovery testingdev-coverage— code coverage with regression gatesdev-security— CVE / license / banned-crate auditdev-deps— unused / outdated dep detectiondev-fuzz— fuzz testing workflowdev-flaky— flaky-test detectiondev-mutate— mutation testing
Status
v0.9.x is the pre-1.0 stabilization line. The generator and CLI are
feature-complete for GitHub Actions output. GitLab CI, Buildkite,
CircleCI targets, and the runtime GitHub Action distribution land in
subsequent 0.9.x releases.
Minimum supported Rust version
1.85 — pinned in Cargo.toml via rust-version and verified by
the MSRV job in CI.
License
Apache-2.0. See LICENSE.