CI for Rust
Build, lint, and test a Rust application using Cargo and Clippy.
Use template →1steps:
2 - label: ":rust: Lint"
3 key: lint
4 commands:
5 - "rustup component add clippy"
6 - "cargo clippy"
7 plugins:
8 - docker#v5.9.0:
9 image: "rust:1.74.1"
10
11 - label: ":rust: Test"
12 key: test
13 command: "cargo test"
14 plugins:
15 - docker#v5.9.0:
16 image: "rust:1.74.1"
17
18 - label: ":rust: Build"
19 command: "cargo build --release"
20 depends_on: ["lint", "test"]
21 plugins:
22 - docker#v5.9.0:
23 image: "rust:1.74.1"
24 artifact_paths:
25 - "target/release/*"
- Languages
- Rust
- Use cases
- Continuous integration, Web application
- Platforms
- Docker
CI for Rust
This template gives you a continuous integration (CI) pipeline that builds, lints, and tests a Rust application.
At a glance:
How it works
This template:
- Lints the Rust code with Clippy.
- Runs tests with Cargo.
- Compiles and uploads a Rust binary as a build artifact.
Next steps
After you select Use template, you’ll:
- Connect the Git repository with your Rust application.
- Modify the commands if necessary.
- Configure the compute—run locally, on-premises, or in the cloud.
- Run the pipeline.
You can then play around with the pipeline settings. For example, run the pipeline locally while you iterate on the definition or set a schedule to trigger a nightly build.
If you need help, please check our documentation, raise an issue , or reach out to support.