Rust CI basics
Learn what Cargo commands do, how CI runs them and where build caching helps.
You need basic familiarity with Cargo; no CI experience is required.
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 runs supported Cargo checks, builds, tests, lint and format checks, nextest suites and declared commands. The surrounding workflow can keep handling checkout, packaging and deployment.
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. Sorus supplies locked dependencies through a gateway. Declared PostgreSQL and Redis services are not yet offered to customer jobs. Tests that require those services, unrestricted network access, an external database or an unavailable toolchain need a runner that provides them. Check the workload scope before moving a job.
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. Use the CLI reference to look up commands and arguments.
For a guided sequence with a working example, read Rust CI from first principles: a CI introduction, a tour of Cargo and rustc, and a guide to measuring build time.