refactor(code-review): decouple review agents from codebase-memory-mcp #606
Workflow file for this run
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
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| concurrency: | |
| group: ci-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| plugin-version-bump: | |
| name: Plugin Version Bump | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'pull_request' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Check changed plugin versions | |
| run: | | |
| BASE_REF="${{ github.event.pull_request.base.ref }}" | |
| BASE=$(git merge-base "origin/$BASE_REF" HEAD) | |
| changed_plugins=$( | |
| git diff --name-only "$BASE"...HEAD -- 'plugins/**' | | |
| awk -F/ 'NF >= 2 { print $2 }' | | |
| sort -u | |
| ) | |
| if [ -z "$changed_plugins" ]; then | |
| echo "No plugin changes detected." | |
| exit 0 | |
| fi | |
| while IFS= read -r plugin; do | |
| manifest="plugins/$plugin/.claude-plugin/plugin.json" | |
| if [ ! -f "$manifest" ]; then | |
| echo "::error::plugins/$plugin/ changed but $manifest is missing. Each plugin must include a .claude-plugin/plugin.json manifest." | |
| exit 1 | |
| fi | |
| if git diff --quiet "$BASE"...HEAD -- "$manifest"; then | |
| echo "::error::plugins/$plugin/ changed but $manifest was not updated. Please bump the plugin version." | |
| exit 1 | |
| fi | |
| old_version=$(git show "$BASE:$manifest" 2>/dev/null | jq -r '.version // empty' || true) | |
| new_version=$(jq -r '.version // empty' "$manifest") | |
| if [ -z "$new_version" ]; then | |
| echo "::error::$manifest must define a version." | |
| exit 1 | |
| fi | |
| if [ -n "$old_version" ] && [ "$old_version" = "$new_version" ]; then | |
| echo "::error::plugins/$plugin/ changed but version in $manifest was not bumped (still $new_version). Please bump the version." | |
| exit 1 | |
| fi | |
| if [ -n "$old_version" ]; then | |
| echo "Plugin $plugin version bumped: $old_version -> $new_version" | |
| else | |
| echo "Plugin $plugin version added: $new_version" | |
| fi | |
| done <<< "$changed_plugins" | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: astral-sh/setup-uv@v6 | |
| with: | |
| python-version: "3.13" | |
| - run: uv sync --frozen --group dev | |
| - run: uv run ruff check . | |
| typecheck: | |
| name: Type Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: astral-sh/setup-uv@v6 | |
| with: | |
| python-version: "3.13" | |
| - run: uv sync --frozen --group dev | |
| - run: uv run pyright | |
| test: | |
| name: Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: astral-sh/setup-uv@v6 | |
| with: | |
| python-version: "3.13" | |
| - run: uv sync --frozen --group dev | |
| - run: uv run pytest plugins/ | |
| design-inventory-ts: | |
| name: TypeScript (design-inventory) | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: tools/design-inventory | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| cache: npm | |
| cache-dependency-path: tools/design-inventory/package-lock.json | |
| - run: npm ci | |
| - run: npm run typecheck | |
| - run: npm test | |
| - name: Verify committed dist bundles are up to date | |
| run: | | |
| DIST=plugins/code/skills/design-inventory/scripts/dist | |
| tracked=$(git -C ../.. ls-files "$DIST/*.mjs" | wc -l) | |
| if [ "$tracked" -lt 10 ]; then | |
| echo "::error::only $tracked tracked bundles under $DIST; bundles are missing or ignored (root .gitignore dist/ rule?). The skill cannot run without them." | |
| exit 1 | |
| fi | |
| npm run build | |
| if ! git -C ../.. diff --exit-code -- "$DIST" || [ -n "$(git -C ../.. status --porcelain -- "$DIST")" ]; then | |
| git -C ../.. status --porcelain -- "$DIST" | |
| echo "::error::scripts/dist is stale or contains untracked bundles. Run 'npm run build' in tools/design-inventory and commit the result." | |
| exit 1 | |
| fi |