Skip to content

Fyko/rust-template

Repository files navigation

rust-template

My opinionated Rust template

Getting Started

  1. Install Cargo Binstall

https://github.com/cargo-bins/cargo-binstall#installation

$ curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
# or if you dont like piping random crap into your shell
$ cargo install cargo-binstall
  1. Install Cargo Make

https://github.com/sagiegurari/cargo-make

$ cargo binstall -y cargo-make
  1. Initialize the project
$ makers setup

Running and testing the project

$ makers dev
$ makers test

Linting and formatting

Effectful formatting and linting was merged into one task:

$ makers format

You can run makers lint just to spit out errors and warnings.

$ makers lint

Deploying

Dockerfile compiles the project to MUSL for a minimal image.

You can build it with:

$ docker buildx build -f ./Dockerfile .

But the easies way is with Docker Compose.

$ docker compose up --build

Additionally, there's a GitHub Action that builds and pushes the image to GitHub Container Registry on every push to main after you uncomment the on trigger.

Integration

The testing GitHub Action runs on every push to main and pull_request and formats, tests and builds the project in that order.

About

my opinionated Rust template

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published