name: CI
on:
push:
branches:
- main
- "features/**"
- "feature/**"
pull_request:
branches:
- main
jobs:
check-and-test:
name: Check, Lint & Test
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Build Web UI
working-directory: ui
run: |
bun install --frozen-lockfile
bun run build
- name: Verify Web UI Bundle Synced
run: |
git diff --exit-code ui/dist/index.html || (echo "Error: ui/dist/index.html is out of sync with ui/src. Run 'bun run build' in ui/ and commit the updated bundle." && exit 1)
- name: Check Formatting
run: cargo fmt --check
- name: Clippy (all targets)
run: cargo clippy --all-targets -- -D warnings
- name: Run Tests
run: cargo test --all-targets
- name: Install cargo-audit
uses: taiki-e/install-action@cargo-audit
- name: Security Audit (cargo-audit)
run: cargo audit