diff --git a/.github/workflows/main-ci.yml b/.github/workflows/main-ci.yml new file mode 100644 index 000000000..146948679 --- /dev/null +++ b/.github/workflows/main-ci.yml @@ -0,0 +1,40 @@ +name: Main CI + +on: + push: + branches: [ main ] + +env: + CARGO_TERM_COLOR: always + +jobs: + format: + name: Format + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + with: + components: rustfmt + - name: Check formatting + run: cargo fmt --check + + clippy: + name: Clippy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + with: + components: clippy + - name: Run clippy + run: cargo clippy -- -D warnings + + test: + name: Test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - name: Run tests + run: cargo test --verbose diff --git a/.github/workflows/pr-ci.yml b/.github/workflows/pr-ci.yml new file mode 100644 index 000000000..b8552397c --- /dev/null +++ b/.github/workflows/pr-ci.yml @@ -0,0 +1,40 @@ +name: PR CI + +on: + pull_request: + branches: [ main ] + +env: + CARGO_TERM_COLOR: always + +jobs: + format: + name: Format + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + with: + components: rustfmt + - name: Check formatting + run: cargo fmt --check + + clippy: + name: Clippy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + with: + components: clippy + - name: Run clippy + run: cargo clippy -- -D warnings + + test: + name: Test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - name: Run tests + run: cargo test --verbose diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..ea8c4bf7f --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/target diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 000000000..4340fcb63 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "rust-hello-world" +version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 000000000..930df0dba --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "rust-hello-world" +version = "0.1.0" +edition = "2024" + +[dependencies] diff --git a/docs.md b/docs.md new file mode 100644 index 000000000..ae80efbfc --- /dev/null +++ b/docs.md @@ -0,0 +1,40 @@ +# Noridoc: rust-hello-world + +Path: @/.worktrees/rust-hello-world + +### Overview + +- Binary Rust package serving as a minimal "Hello World" example +- Verifies Rust toolchain installation and basic project setup (rustc 1.91.0, cargo 1.91.0) +- Uses standard Cargo project structure with src/main.rs entry point +- Edition 2024 - latest Rust edition available + +### How it fits into the larger codebase + +- Located in a git worktree (separate working directory) to maintain isolation from the main monorepo +- Does not affect main repository commits since .worktrees/ is gitignored at @/.gitignore +- Demonstrates the first Rust infrastructure setup for the Nori system +- Serves as a template for future Rust packages or can be replaced with actual project code +- No dependencies on other parts of the monorepo; entirely self-contained + +### Core Implementation + +- Entry point: src/main.rs contains a simple println!("Hello, world!") implementation +- Build configuration: Cargo.toml defines package metadata (name: rust-hello-world, version: 0.1.0, edition: 2024) +- Build output directory: target/ (gitignored via local .gitignore) +- Cargo.lock tracks dependency versions (currently no external dependencies) +- No dependencies defined, pure standard library usage + +### Things to Know + +- This is a binary crate (executable), not a library crate +- The gitignored .worktrees/ directory means this package does not integrate with the main repository version control +- Rust 1.91.0 is the minimum required toolchain - defined by rust-toolchain.toml if present or system default +- target/ build artifacts are local to the worktree and gitignored +- The package can be compiled with `cargo build` or run directly with `cargo run` +- CI/CD: Separate GitHub Actions workflows for different Git events: + - @/.github/workflows/pr-ci.yml runs on pull requests + - @/.github/workflows/main-ci.yml runs on pushes to main + - Both run: cargo fmt --check (formatting), cargo clippy -- -D warnings (linting), cargo test --verbose (tests) + +Created and maintained by Nori. diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 000000000..e7a11a969 --- /dev/null +++ b/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +}