Skip to content

rust-docs

cargo doc --no-deps --all-features with RUSTDOCFLAGS=-D warnings. Catches doctest / intra-doc-link breakage at MR time rather than at release. Sibling of tofu-lint's terraform-docs-drift gate and go-lint's godoc-equivalent (Go doesn't have a separate gate — go vet catches most). Single job, MR-only by default, shares the target/ cache with rust-test via the same Cargo.lock-keyed key (pull-only — it runs in docs, after rust-test already warmed it).

Jobs

Job What it runs
cargo-doc cargo doc $[[ inputs.extra_args ]] $[[ inputs.features ]]

Inputs

Input Type Default Description
image string dev-tools:v0.1.2 Rust toolchain image.
stage string docs GitLab CI stage. Consumers must declare it in stages:.
if string '$CI_PIPELINE_SOURCE == "merge_request_event"' Gating rules:if:.
changes array ["**/*.rs", "**/Cargo.toml", "Cargo.lock", "rustfmt.toml", "rust-toolchain.toml", ".gitlab-ci.yml"] Change-detection paths.
features string "--all-features" Feature flags for cargo doc.
extra_args string "--workspace --no-deps" Extra arguments for cargo doc.
extra_before_script string "" Shell snippet prepended to before_script (apt installs for native deps).

Usage

include:
  - component: gitlab.com/phpboyscout/cicd/[email protected]

See also