8000 ci: add the GitHub Actions workflow + git hooks the docs already reference by adeelahmad · Pull Request #1 · adeelahmad/aloop · GitHub
[go: up one dir, main page]

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
11 changes: 11 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
# pre-commit — fast, deterministic, no network/tokens. Installed by `make hooks`.
# Mirrors the cheap half of `make ci`: formatting, JSON manifests, eval suites,
# and version agreement. Heavier build/test/lint runs in pre-push.
set -euo pipefail
cd "$(git rev-parse --show-toplevel)"
Comment on lines +5 to +6
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Honor the documented hook bypass

When a developer follows the README's documented SKIP_HOOKS=1 bypass, this hook still proceeds to run the Make targets because there is no early check for that environment variable (the same pattern exists in pre-push). That makes the newly added hooks unexpectedly block commits/pushes in the exact scenario the docs say should be bypassable, such as a known failing local dependency or an intentional WIP commit.

Useful? React with 👍 / 👎.


command -v make >/dev/null 2>&1 || { echo "pre-commit: make not found; skipping"; exit 0; }

echo "pre-commit: fmt-check · json · eval-validate · version-check"
make fmt-check json eval-validate version-check
12 changes: 12 additions & 0 deletions .githooks/pre-push
10BC8
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
# pre-push — the full local gate before publishing. Installed by `make hooks`.
# Runs everything CI runs (`make ci`): fmt-check, lint (clippy · shellcheck · json),
# test (ctx-symbols + md-db), and eval-suite validation. shellcheck self-skips with
# a warning if it is not installed; CI enforces it.
set -euo pipefail
cd "$(git rev-parse --show-toplevel)"

command -v make >/dev/null 2>&1 || { echo "pre-push: make not found; skipping"; exit 0; }

echo "pre-push: make ci (fmt-check · lint · test · eval-validate)"
make ci
70 changes: 70 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# CI — the checks `make ci` + `make validate` run, mirrored on every push/PR.
# Documented in README.md ("Continuous integration"). Three independent jobs:
# rust — ctx-symbols + md-db: fmt-check, clippy -D warnings, tests
# shellcheck — lints every gate script (errors fail the build)
# plugin — JSON sanity + eval-suite validation + `claude plugin validate --strict`
name: CI

on:
push:
branches: [master]
pull_request:

permissions:
contents: read

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

jobs:
rust:
name: rust (fmt · clippy · test)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
with:
workspaces: |
plugin/tools/ctx-symbols
plugin/tools/md-db
- name: fmt --check
run: make fmt-check
- name: clippy -D warnings
run: make clippy
- name: test (ctx-symbols + md-db)
run: make test

shellcheck:
name: shellcheck (gate scripts)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install shellcheck
run: sudo apt-get update && sudo apt-get install -y shellcheck
- name: Lint gate scripts
run: make shellcheck

plugin:
name: plugin (json · evals · validate)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Validate plugin.json + marketplace.json
run: make json
- name: Validate every eval suite's JSON
run: make eval-validate
- name: Assert versions agree (plugin.json · Cargo.toml · CHANGELOG)
run: make version-check
- name: Install Claude Code CLI
run: |
curl -fsSL https://claude.ai/install.sh | bash -s stable
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- name: claude plugin validate --strict
run: claude plugin validate ./plugin --strict
Loading
0