From 52a8f0f868590868757813f074a1c7129166798f Mon Sep 17 00:00:00 2001 From: leesam Date: Wed, 7 Jan 2026 22:41:02 +0900 Subject: [PATCH] ai: enable serena mcp for claude ci --- .github/workflows/claude-code-review.yml | 33 ++++++++++++++++++++++-- .github/workflows/claude.yml | 32 ++++++++++++++++++++++- 2 files changed, 62 insertions(+), 3 deletions(-) diff --git a/.github/workflows/claude-code-review.yml b/.github/workflows/claude-code-review.yml index 205b0fe..2fd84cf 100644 --- a/.github/workflows/claude-code-review.yml +++ b/.github/workflows/claude-code-review.yml @@ -31,6 +31,35 @@ jobs: with: fetch-depth: 1 + - name: Setup uv + uses: astral-sh/setup-uv@v7 + with: + enable-cache: true + + - name: Cache uv tools + uses: actions/cache@v4 + with: + path: ~/.local/share/uv/tools + key: ${{ runner.os }}-uv-tools-serena + restore-keys: | + ${{ runner.os }}-uv-tools- + + - name: Install Serena + run: uv tool install --from git+https://github.com/oraios/serena serena-agent + + - name: Create Serena cache key + id: serena-cache-hash + run: echo "hash=${{ runner.os }}-serena-cache-${{ hashFiles('**/*.swift', 'Tuist/**/*', 'Projects/**/*.swift') }}" >> $GITHUB_OUTPUT + + - name: Cache Serena data + uses: actions/cache@v4 + id: cache-serena + with: + path: .serena + key: ${{ steps.serena-cache-hash.outputs.hash }} + restore-keys: | + ${{ runner.os }}-serena-cache- + - name: Run Claude Code Review id: claude-review uses: anthropics/claude-code-action@v1 @@ -53,5 +82,5 @@ jobs: # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md # or https://docs.claude.com/en/docs/claude-code/cli-reference for available options - claude_args: '--allowed-tools "Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"' - + claude_args: | + --allowed-tools "mcp__serena__*, Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)" diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml index 412cef9..d8c83ab 100644 --- a/.github/workflows/claude.yml +++ b/.github/workflows/claude.yml @@ -30,6 +30,35 @@ jobs: with: fetch-depth: 1 + - name: Setup uv + uses: astral-sh/setup-uv@v7 + with: + enable-cache: true + + - name: Cache uv tools + uses: actions/cache@v4 + with: + path: ~/.local/share/uv/tools + key: ${{ runner.os }}-uv-tools-serena + restore-keys: | + ${{ runner.os }}-uv-tools- + + - name: Install Serena + run: uv tool install --from git+https://github.com/oraios/serena serena-agent + + - name: Create Serena cache key + id: serena-cache-hash + run: echo "hash=${{ runner.os }}-serena-cache-${{ hashFiles('**/*.swift', 'Tuist/**/*', 'Projects/**/*.swift') }}" >> $GITHUB_OUTPUT + + - name: Cache Serena data + uses: actions/cache@v4 + id: cache-serena + with: + path: .serena + key: ${{ steps.serena-cache-hash.outputs.hash }} + restore-keys: | + ${{ runner.os }}-serena-cache- + - name: Run Claude Code id: claude uses: anthropics/claude-code-action@v1 @@ -46,5 +75,6 @@ jobs: # Optional: Add claude_args to customize behavior and configuration # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md # or https://docs.claude.com/en/docs/claude-code/cli-reference for available options - # claude_args: '--allowed-tools Bash(gh pr:*)' + claude_args: | + --allowed-tools "mcp__serena__*,Bash(gh pr:*)"