Skip to content
Open
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
6 changes: 6 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
# Pre-commit hook: Fast formatting check before creating commits.
set -e

echo "==> Running cargo fmt --all --check..."
cargo fmt --all --check
16 changes: 16 additions & 0 deletions .githooks/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
# Pre-push hook: Comprehensive validation before pushing to remote.
set -e

echo "==> Checking headless gateway (AGENTS.md rule)..."
cargo check -p gateway --no-default-features

echo "==> Running Clippy on workspace..."
cargo clippy --workspace --exclude workshop --exclude workshop-server --all-targets --all-features -- -D warnings

if command -v cargo-deny >/dev/null 2>&1; then
echo "==> Running cargo deny check..."
cargo deny check
fi

echo "==> Pre-push checks passed successfully."
160 changes: 112 additions & 48 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,31 @@ concurrency:
# to anonymous, which is what the cache is there to make rare.
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
RUSTUP_TOOLCHAIN: stable

jobs:
check:
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt

- name: Format
run: cargo fmt --all --check

clippy:
runs-on: ubuntu-latest
# RUSTUP_TOOLCHAIN outranks the repo's rust-toolchain.toml (pinned to the
# MSRV for local builds); this job means to test stable.
env:
RUSTUP_TOOLCHAIN: stable
steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
components: clippy

- name: Cache cargo
uses: Swatinem/rust-cache@v2
Expand All @@ -40,35 +51,52 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: crates/*/ui/package-lock.json

- name: Install UI dependencies
working-directory: crates/workshop-server/ui
run: npm ci

- name: Install config UI dependencies
working-directory: crates/gateway-config-ui/ui
run: npm ci

- name: Format
run: cargo fmt --all --check
run: |
npm ci --prefix crates/workshop-server/ui
npm ci --prefix crates/gateway-config-ui/ui

# The desktop packages stay in their platform jobs because Linux needs
# Tauri system libraries. All gateway and STT features are pure Rust
# now that whisper.cpp is loaded from a managed runtime artifact.
- name: Clippy
run: cargo clippy --workspace --exclude workshop --exclude workshop-server --all-targets --all-features -- -D warnings

- name: Test
run: cargo test --locked --workspace --exclude workshop --exclude workshop-server --all-features
test:
runs-on: ubuntu-latest
env:
RUSTUP_TOOLCHAIN: stable
steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@stable

- name: Install cargo-nextest
uses: taiki-e/install-action@nextest

- name: Cache cargo
uses: Swatinem/rust-cache@v2

- name: Cache the embedding model
uses: ./.github/actions/hf-model-cache

- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: crates/*/ui/package-lock.json

- name: Install UI dependencies
run: |
npm ci --prefix crates/workshop-server/ui
npm ci --prefix crates/gateway-config-ui/ui

- name: Test (concurrent via nextest)
run: cargo nextest run --locked --workspace --exclude workshop --exclude workshop-server --all-features

- name: Doctests
run: cargo test --workspace --exclude workshop --exclude workshop-server --all-features --doc

- name: Docs
env:
RUSTDOCFLAGS: -D warnings
run: cargo doc --workspace --no-deps --all-features --exclude workshop --exclude workshop-server

- name: Check headless gateway
run: cargo check -p gateway --no-default-features

Expand All @@ -83,6 +111,36 @@ jobs:
exit 1
fi

docs:
runs-on: ubuntu-latest
env:
RUSTUP_TOOLCHAIN: stable
RUSTDOCFLAGS: -D warnings
steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@stable

- name: Cache cargo
uses: Swatinem/rust-cache@v2

- name: Cache the embedding model
uses: ./.github/actions/hf-model-cache

- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: crates/*/ui/package-lock.json

- name: Install UI dependencies
run: |
npm ci --prefix crates/workshop-server/ui
npm ci --prefix crates/gateway-config-ui/ui

- name: Docs
run: cargo doc --workspace --no-deps --all-features --exclude workshop --exclude workshop-server

check-workshop:
runs-on: windows-latest
env:
Expand All @@ -94,6 +152,9 @@ jobs:
with:
components: clippy

- name: Install cargo-nextest
uses: taiki-e/install-action@nextest

- name: Cache cargo
uses: Swatinem/rust-cache@v2

Expand All @@ -103,16 +164,19 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: crates/*/ui/package-lock.json

- name: Install UI dependencies
working-directory: crates/workshop-server/ui
run: npm ci
run: |
npm ci --prefix crates/workshop-server/ui
npm ci --prefix crates/gateway-config-ui/ui

- name: Clippy (workshop)
run: cargo clippy -p workshop -p workshop-server --all-targets -- -D warnings

- name: Test (workshop)
run: cargo test --locked -p workshop -p workshop-server
- name: Test (workshop, concurrent via nextest)
run: cargo nextest run --locked -p workshop -p workshop-server

- name: Clean tree
shell: bash
Expand Down Expand Up @@ -146,15 +210,18 @@ jobs:
- name: Install Tauri system packages
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libssl-dev librsvg2-dev
sudo apt-get install -y --no-install-recommends libwebkit2gtk-4.1-dev libssl-dev librsvg2-dev

- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: crates/*/ui/package-lock.json

- name: Install UI dependencies
working-directory: crates/workshop-server/ui
run: npm ci
run: |
npm ci --prefix crates/workshop-server/ui
npm ci --prefix crates/gateway-config-ui/ui

- name: Build (workshop, Linux)
run: cargo build --locked -p workshop
Expand All @@ -179,6 +246,8 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: crates/*/ui/package-lock.json

- name: Install UI dependencies
working-directory: crates/workshop-server/ui
Expand Down Expand Up @@ -220,8 +289,9 @@ jobs:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@1.89.0
with:
components: rustfmt

- name: Install cargo-nextest
uses: taiki-e/install-action@nextest

- name: Cache cargo
uses: Swatinem/rust-cache@v2
Expand All @@ -232,31 +302,25 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: crates/*/ui/package-lock.json

- name: Install UI dependencies
working-directory: crates/workshop-server/ui
run: npm ci

- name: Install config UI dependencies
working-directory: crates/gateway-config-ui/ui
run: npm ci

- name: Build and test on MSRV
run: |
cargo build --locked --workspace --exclude workshop --exclude workshop-server --all-features
cargo test --locked --workspace --exclude workshop --exclude workshop-server --all-features
npm ci --prefix crates/workshop-server/ui
npm ci --prefix crates/gateway-config-ui/ui

- name: Test on MSRV
run: cargo nextest run --locked --workspace --exclude workshop --exclude workshop-server --all-features

supply-chain:
runs-on: ubuntu-latest
env:
RUSTUP_TOOLCHAIN: stable
steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@stable

- name: Install cargo-deny and cargo-audit
run: cargo install cargo-deny cargo-audit --locked
- uses: taiki-e/install-action@v2
with:
tool: cargo-deny, cargo-audit

- name: cargo deny
run: cargo deny check
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/dist-ci/build-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: crates/*/ui/package-lock.json
- name: Install UI dependencies
run: npm ci --prefix crates/workshop-server/ui
- name: Install config UI dependencies
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: crates/*/ui/package-lock.json
- name: Install UI dependencies
run: |
npm ci --prefix crates/workshop-server/ui
Expand Down Expand Up @@ -97,6 +99,8 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: crates/*/ui/package-lock.json
- name: Install UI dependencies
run: |
npm ci --prefix crates/workshop-server/ui
Expand Down Expand Up @@ -157,6 +161,8 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: crates/*/ui/package-lock.json

- name: Install UI dependencies
working-directory: crates/workshop-server/ui
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/release-workshop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: crates/*/ui/package-lock.json

- name: Install UI dependencies
working-directory: crates/workshop-server/ui
Expand All @@ -88,7 +90,7 @@ jobs:
# xdg-utils: the AppImage bundler shells out to xdg-open, which the
# ARM runner images do not preinstall (the x64 image does).
# https://github.com/tauri-apps/tauri-action/issues/1319
sudo apt-get install -y libwebkit2gtk-4.1-dev libssl-dev librsvg2-dev xdg-utils
sudo apt-get install -y --no-install-recommends libwebkit2gtk-4.1-dev libssl-dev librsvg2-dev xdg-utils

# SIGNING (Windows): import the Authenticode certificate here once an
# EV/OV cert exists; tauri-action picks it up from the machine store.
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@
# The gateway sidecar staged for bundle.externalBin by CI before
# `tauri build` (crates/workshop/tauri.conf.json); a build artifact.
/crates/workshop/binaries/
/plan-dist-manifest.json
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ Rust 1.89 or later.

Build, format, and test before you open a PR. CI runs `cargo fmt --check`, `clippy -D warnings`, and `cargo test --workspace`.

To enable automatic local pre-commit and pre-push validation hooks:

```bash
git config core.hooksPath .githooks
```

![Creator](images/promptforge-portrait.png)

## License
Expand Down
Loading