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-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.
- 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
| Trigger | Badge | |
|---|---|---|
| ℹ️ | PR merge event (destination: trunk) | |
| ℹ️ | Scheduled (weekly) | |
| ℹ️ | PR open event (destination: trunk) |
In order to run own copy of the project one must fulfill the following requirements.
- 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
commitizenpackage, the instructions for Linux will possibly work (see below)
🏆 Visual Studio Code - recommended for all operating systems
- Bash 5
- Python 3.6+ -
for OSX to use the global commitizen installation - NodeJS -
for Linux to use the global commitizen installation - Git
- Rust
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 czAlternatively, 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 CommitizenUsing 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 commitizenone can use one of the following commands to initiate the commit process
cz commitor
cz cThis 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.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.
- 📖 The Rust Book — Learn Rust
- 📦 Cargo Documentation — Build & publish
- 🚀 Crates.io — Official package registry
# Build entire workspace
cargo build
# Build a specific crate
cargo build -p crate-name
# Build for release
cargo build --release# Run all tests
cargo test
# Run tests for a specific crate
cargo test -p crate-name
# Run tests with output
cargo test -- --nocapture# Run clippy linter
cargo clippy
# Format code
cargo fmt
# Check formatting
cargo fmt -- --check# Generate and open documentation
cargo doc --open# Dry run before publishing
cargo publish --dry-run
# Publish to crates.io
cargo publishrustup --helpcargo --help| 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 |
