ci: add AI code review workflow
This commit is contained in:
parent
2ac89889f4
commit
7e135a53ec
1 changed files with 37 additions and 0 deletions
37
.github/workflows/ai-review.yml
vendored
Normal file
37
.github/workflows/ai-review.yml
vendored
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
name: AI Code Review
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
|
||||
jobs:
|
||||
ai-review:
|
||||
name: AI Code Review (Local LLM)
|
||||
runs-on: [self-hosted, ai-review]
|
||||
timeout-minutes: 30
|
||||
concurrency:
|
||||
group: ai-review-pr-${{ github.event.pull_request.number }}
|
||||
cancel-in-progress: true
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Run AI Code Review
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
OLLAMA_HOST: http://127.0.0.1:11434
|
||||
OLLAMA_MODEL: qwen2.5-coder:32b-instruct-q4_K_M
|
||||
run: |
|
||||
cd /opt/ai-review
|
||||
python3 main.py --pr-number ${{ github.event.pull_request.number }} --repo ${{ github.repository }}
|
||||
|
||||
- name: Cost report
|
||||
if: always()
|
||||
run: |
|
||||
cd /opt/ai-review
|
||||
python3 main.py --pr-number 0 --repo x/x --report 2>/dev/null || python3 -c "
|
||||
import sys; sys.path.insert(0,".");
|
||||
from cost_tracker import print_cost_report;
|
||||
print_cost_report()
|
||||
"
|
||||
Loading…
Add table
Add a link
Reference in a new issue