Skip to content
Public template

About

A practical Rust workspace template for automated CI, conventional commits, cross-platform development, data pipelines, and machine-learning projects.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

1 watching

Forks

Repository files navigation

Rust workspace

A reusable Rust workspace starter for developers building maintainable applications with automated GitHub Actions CI, conventional commits, cross-platform tooling, data pipelines, and machine-learning experiments.

Rust

Commitizen friendly License: MIT

Overview

rust-workspace is a production-ready template for Rust developers building maintainable applications with enterprise-grade tooling. It provides battle-tested configurations for monorepo management, automated CI/CD pipelines, conventional commits, and cross-platform development perfect for data pipelines, CLI tools, libraries, and machine-learning experiments.

Whether you're building a single-crate project or managing multiple interconnected packages, this template aims to reduce configuration boilerplate and establishe best practices from day one.

Key Features

  • Workspace Architecture — Manage multiple crates efficiently with Cargo workspace
  • Automated CI/CD — GitHub Actions workflows for testing, linting, and publishing
  • Conventional Commits — Commitizen integration for standardized commit messages
  • Cross-Platform — Seamless development on Linux, macOS, and Windows
  • Data Pipelines — DVC integration for version-controlled data and experiments
  • Developer Experience — Pre-configured VS Code, linting, formatting, and git hooks
  • Security & Quality — Pre-commit hooks, code analysis, and security scanning
  • Type-Safe — Rust's powerful type system catches errors at compile time
  • Performance — Compiled binaries with zero-cost abstractions

Workflows

Trigger Badge
ℹ️ PR merge event (destination: trunk) trunk
ℹ️ Scheduled (weekly) validate-codeowners
ℹ️ PR open event (destination: trunk) validate-pr

Requirements

In order to run own copy of the project one must fulfill the following requirements.

Supported operating systems

🏆 Debian based Linux

  • install all dependencies required to work with the project except NodeJS: rustup, commitizen, shellcheck
    bash tools/shell/install.sh all
  • see help for available options
    bash tools/shell/install.sh ?

🆗 OSX

  • install all dependencies required to work with the project except Python: rustup, commitizen, shellcheck
    bash tools/shell/install.sh all osx
  • see help for available options
    bash tools/shell/install.sh ?

🤷 Windows

  • install shellcheck
    iwr -useb get.scoop.sh | iex
    scoop install shellcheck
  • recommended shell: Git for Windows > Git BASH
  • configure Git to use LF as a carriage return
    git config --global core.autocrlf false
    git config --global core.eol lf
  • one will have to figure out oneself how to install the commitizen package, the instructions for Linux will possibly work (see below)

Integrated development environment

🏆 Visual Studio Code - recommended for all operating systems

Core dependencies

Committing changes to the repo

Linux

Using commitizen cli is mandatory.

The commit message are validated during the premerge checks.

It is assumed that Node.js is installed.

Given the NodeJS is installed, and commitizen cli is installed as a global dependency, the following command should be used to initiate the commit process

git cz

Alternatively, given there are no conflicts with other projects that use the commitizen npm package, one could install commitizen globally via pypi like this

sudo pip3 install -U Commitizen

OSX

Using commitizen is mandatory.

The commit message are validated during the premerge checks.

After installing the package as a global utility using the following command

brew install commitizen

one can use one of the following commands to initiate the commit process

cz commit

or

cz c

General Tooling

This project was generated using Cargo.

The Rust and Cargo logos (bitmap and vector) are owned by the Rust Foundation and distributed under the terms of the Creative Commons Attribution license (CC-BY). The logos are used in compliance with the Rust Foundation Logo Policy and Media Guide. No changes have been made to the original logos used by the project. The project was created for educational purposes.

What is Cargo

Cargo is the Rust package manager. Cargo downloads your Rust package's dependencies, compiles your packages, makes distributable packages, and uploads them to crates.io, the Rust community package registry.

Quick Start & Documentation

Common Commands

Building

# Build entire workspace
cargo build

# Build a specific crate
cargo build -p crate-name

# Build for release
cargo build --release

Testing

# Run all tests
cargo test

# Run tests for a specific crate
cargo test -p crate-name

# Run tests with output
cargo test -- --nocapture

Code Quality

# Run clippy linter
cargo clippy

# Format code
cargo fmt

# Check formatting
cargo fmt -- --check

Documentation

# Generate and open documentation
cargo doc --open

Publishing

# Dry run before publishing
cargo publish --dry-run

# Publish to crates.io
cargo publish

Further help

rustup --help
cargo --help

Technology Stack

Category Technology Purpose
Build Cargo Rust package manager and build system
Build rustup Rust toolchain manager
Testing Cargo test Built-in unit testing framework
Code Quality Clippy Linter for catching common mistakes
Formatting Rustfmt Code formatter for consistent style
CI/CD GitHub Actions Automated testing and deployment workflows
Version Control Git Distributed version control
Commits Commitizen Interactive conventional commits CLI
Pre-commit Cargo-husky Git hooks automation
Data Pipeline DVC Data and ML workflow versioning
IDE Visual Studio Code Recommended IDE with Rust extension

About

A practical Rust workspace template for automated CI, conventional commits, cross-platform development, data pipelines, and machine-learning projects.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

1 watching

Forks

Used by

Contributors

Languages