ci(core): add quality gates with lefthook hooks and GitHub Actions CI

Merged
MP
7mo ago
+701-20

Summary

  • Lefthook pre-commit/pre-push hooks for local quality enforcement
  • GitHub Actions CI pipeline with Rust checks, frontend checks, and cross-platform build matrix
  • Contributor automation (auto-label, welcome messages, stale cleanup)
  • Project configuration files (.editorconfig, CHANGELOG.md, labeler.yml)
  • Updated CONTRIBUTING.md and PR template with complete instructions

Changes

Local quality gates (lefthook)

  • Pre-commit (parallel): cargo fmt --check, cargo clippy -D warnings, oxlint, secret file detection
  • Pre-push (parallel): cargo test, vitest run, tsc -b

CI pipeline (.github/workflows/ci.yml)

  • rust-checks: fmt, clippy, tests with coverage (cargo-llvm-cov, 80% threshold)
  • frontend-checks: oxlint, tsc -b, vitest with coverage
  • build: cross-platform matrix (Linux, macOS, Windows) with fail-fast: false
  • Explicit permissions: contents: read for least-privilege

Contributor automation (.github/workflows/contributor.yml)

  • Auto-labeling PRs by file path (labeler.yml)
  • Welcome messages for first-time contributors
  • Stale issue/PR cleanup (60 days)

Configuration

  • .editorconfig for cross-editor consistency
  • CHANGELOG.md (Keep a Changelog format)
  • Updated CONTRIBUTING.md with dev setup, testing, and linting instructions
  • Updated PR template with specific checklist (cargo test, npm test, CHANGELOG)

Test plan

  • lefthook install runs via npm run prepare
  • Pre-commit hooks installed in .git/hooks/
  • cargo fmt --check passes
  • cargo clippy -- -D warnings passes
  • oxlint . passes (0 errors)
  • tsc -b passes
  • vitest run passes
  • CI pipeline runs on this PR (GitHub Actions)
  • Cross-platform build matrix completes

Summary by cubic

Adds local quality gates with lefthook and a GitHub Actions CI pipeline covering linting, tests, coverage, secret-file checks, and Rust dependency audits. Also upgrades src-tauri to Rust 2024, adds contributor automation and editor/docs configs, and fixes Rust CI on Linux by installing required system deps.

  • New Features

    • Local lefthook hooks: fmt, clippy, oxlint, secret-file check (broadened regex; ignores deleted files); pre-push runs cargo test, vitest, and tsc -b.
    • CI: Rust fmt/clippy/tests with cargo-llvm-cov (reports only) and cargo audit; Linux GTK/WebKit deps; frontend oxlint, tsc -b, vitest with coverage; CI-side secret-file gate; cross-platform build matrix; least-privilege permissions.
    • Contributor automation: auto-label by paths, welcome messages, mark stale after 60 days.
    • Config/docs: .editorconfig, CHANGELOG.md, updated CONTRIBUTING.md and PR template.
  • Dependencies

    • Add dev deps: lefthook, @vitest/coverage-v8, @types/node.
    • Add scripts: prepare (install lefthook), test:coverage, lint:fix, typecheck.

Summary by CodeRabbit

  • Chores

    • Added repository-wide editor settings, updated ignore rules, tooling scripts, git hooks, dependency scripts, and bumped Rust edition.
  • CI

    • Introduced a CI pipeline with linting, tests, coverage gates, and a cross-platform build matrix.
    • Added contributor automation for auto-labeling, welcome messages, and scheduled stale management.
  • Documentation

    • Added a contributor guide, updated the PR checklist template, and initialized the changelog.