Skip to content

Basic Project Setup

This example uses the current supported CLI surface.

my-rust-project/
.assura/
config.yml
src/
main.rs
Cargo.toml
README.md
  1. Create a Rust project

    Terminal window
    cargo new my-rust-project
    cd my-rust-project
  2. Install Assura

    Terminal window
    curl -fsSL https://raw.githubusercontent.com/rothnic/assura/master/website/public/install.sh | sh
  3. Initialize Assura

    Terminal window
    assura init
  4. Run validation

    Terminal window
    assura check
  5. Add a stricter shape

    Edit .assura/config.yml:

    structure:
    ./:
    extra: false
    README.md: exists:1
    Cargo.toml: exists:1
    src/: exists:1
    "*.lock": exists:0-1
    src/:
    .rs: snake_case
    exclude:
    - "target/**"

    The root policy mirrors the project tree. It requires the public files, allows one lockfile, closes the root to unexpected direct children, and checks Rust source names where the source files live.

  6. Check again

    Terminal window
    assura check --format text
name: Assura
on: [push, pull_request]
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: curl -fsSL https://raw.githubusercontent.com/rothnic/assura/master/website/public/install.sh | sudo env BIN_DIR=/usr/local/bin sh
- run: assura check --format text