Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# cargo configuration for ember
# https://doc.rust-lang.org/cargo/reference/config.html

[build]
# use all available cores for parallel compilation
jobs = -1

[profile.release]
# link-time optimization for smaller, faster binaries
lto = true
# single codegen unit for better optimization (slower compile)
codegen-units = 1
# strip symbols from release binaries
strip = true
# abort on panic for smaller binary and cleaner crash behavior
panic = "abort"

[profile.dev]
# faster incremental builds in dev mode
incremental = true

[profile.test]
# keep debug info in test builds for better backtraces
debug = true

# alias for common operations
[alias]
b = "build"
c = "check"
t = "test"
r = "run"
67 changes: 67 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: ci

on:
push:
branches: [main]
pull_request:
branches: [main]

env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1

jobs:
check:
name: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- name: fmt
run: cargo fmt --all --check
- name: clippy
run: cargo clippy --workspace -- -D warnings
- name: check
run: cargo check --workspace

test:
name: test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: test
run: cargo test --workspace

build:
name: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: build release
run: cargo build --release
- name: upload binary
uses: actions/upload-artifact@v4
with:
name: ember-server
path: target/release/ember-server

security:
name: security
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: install cargo-audit
run: cargo install cargo-audit
- name: audit
run: cargo audit
73 changes: 73 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# contributing to ember

thanks for your interest in contributing to ember. this document covers the
development workflow and standards we follow.

## getting started

```bash
# clone the repo
git clone https://github.com/kacy/ember
cd ember

# build and test
make check
```

## development workflow

1. **create a branch** from `main` for your work
- use descriptive names: `feat/add-pubsub`, `fix/memory-leak`, `docs/api-examples`

2. **make changes** following the code standards below

3. **run checks** before committing:
```bash
make check # runs fmt, clippy, and tests
```

4. **commit** with clear messages:
- use lowercase, present tense: `add pubsub support`, `fix memory tracking bug`
- keep commits atomic and focused

5. **open a pull request** against `main`
- include a summary of changes
- describe what was tested
- note any design considerations

## code standards

### style

- run `cargo fmt` before committing
- run `cargo clippy` with warnings as errors
- no `unwrap()` in library code — use proper error handling
- no `unsafe` without a comment explaining why

### documentation

- every public item needs a doc comment
- include examples for complex apis
- document panic conditions and performance characteristics

### testing

- add tests for new functionality
- focus on edge cases and error paths
- run the full test suite before submitting

## project structure

```
crates/
├── ember-server/ # main server binary
├── ember-core/ # sharded engine and data structures
├── ember-protocol/ # resp3 parsing and commands
├── ember-persistence/# aof and snapshots
├── ember-cluster/ # distributed clustering (wip)
└── ember-cli/ # command-line client
```

## questions?

open an issue or start a discussion — we're happy to help.
Loading