Repository navigation
ci: add the GitHub Actions workflow + git hooks the docs already reference #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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)" | ||
|
|
||
| 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 | ||
10BC8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a developer follows the README's documented
SKIP_HOOKS=1bypass, this hook still proceeds to run the Make targets because there is no early check for that environment variable (the same pattern exists inpre-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 👍 / 👎.