Set up GitLab CI for Rust by creating a .gitlab-ci.yml file that defines a test job using the official Rust Docker image.
Create a .gitlab-ci.yml file in your project root to define jobs that install Rust, build your project, and run tests on every push.
stages:
- test
test:
stage: test
image: rust:1.90
script:
- rustup update
- cargo test
This configuration triggers on every push, installs Rust 1.90, updates the toolchain, and runs your test suite.
GitLab CI configuration tells GitLab how to automatically check your Rust code whenever you save changes. It acts like a robot that installs the necessary tools, compiles your project, and runs your tests to ensure nothing is broken before you merge your work.