Skip to main content

Rust

This guide provides tips and hints for building Rust projects.

Overview

Rust is not preinstalled on Linux Semaphore environments. You must use Docker Environments to build and test Rust projects.

How to compile Rust code

You may use one of the pre-built Rust images to run the jobs in a Docker-based environment.

  1. Open the workflow editor

  2. Select the pipeline

  3. Select Docker Containers in the Environment Type

  4. Select one of the available machines

  5. Type the name of a Rust image, e.g. semaphoreci/rust:1.75

    Selecting a rust image

  6. Configure your jobs, for example

    checkout
    rustc main.rs
    ./main
  7. Press Run the workflow

See artifacts to learn how to save and persist the built binary.

Find Dockerfiles to build your custom Rust images in the semaphoreci/docker-images repository.