Rust CI basics
An introduction to Cargo operations, CI workflows and build caching.
For: New to Rust CI
This introduction assumes basic familiarity with Cargo; no CI experience is required. If you already maintain Rust CI, skip to running Sorus from CI or the CLI reference.
Cargo check, build and test
cargo check checks whether Rust code compiles without producing the final executable. It provides feedback on types and compiler errors.
cargo build compiles code and produces build outputs. --release uses the release profile, which performs different work from the default development profile.
cargo test builds and runs the tests selected by Cargo and the command’s arguments. Successful compilation alone does not show that tests pass.
A workspace contains related Rust packages. --workspace selects the workspace instead of the default package selection. Features, profiles and targets also change the work performed.
CI workflows
Continuous integration runs checks when source changes. A typical workflow checks out code, selects a toolchain, prepares dependencies, runs checks or tests, and reports the result on a commit or pull request.
Workflows can also format code, run linters, start databases, package releases and deploy services. Sorus currently focuses on supported Cargo check, build and test jobs. The surrounding steps remain in the existing workflow.
Rust build caching
The compiler builds the code needed for a selected toolchain, target, feature set and profile. Changes to those inputs can make earlier outputs incompatible.
Caches can hold downloaded dependencies, compiled outputs or incremental build state. Each avoids different work. A warm run with compatible state and a cold run with no restored state measure different conditions.
For more detail about these mechanisms, read caching and reuse.
using Sorus
A terminal, CI system or agent can submit a Rust job to Sorus and receive its result. The existing workflow controls when to submit it and what happens afterwards.
A job’s dependencies determine whether it fits the service. Tests that need unrestricted network access, a database service or an unlisted toolchain are outside the candidate workload scope.
evaluate a job
An evaluation needs a repeatable baseline: the same source, Cargo command, toolchain and declared cache state. Multiple runs show variation that a single timing cannot.
The Cargo check tutorial walks through a first Sorus job. The CI integration guide explains how to add one to an existing workflow, and the benchmark method defines a comparable measurement.