43 lines
1.1 KiB
YAML
43 lines
1.1 KiB
YAML
name: Codeflash AiService
|
|
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- "django/aiservice/**"
|
|
workflow_dispatch:
|
|
|
|
defaults:
|
|
run:
|
|
working-directory: ./django/aiservice
|
|
|
|
jobs:
|
|
optimize:
|
|
name: Optimize new code in this PR
|
|
if: ${{ github.actor != 'codeflash-ai[bot]' }}
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
CODEFLASH_API_KEY: ${{ secrets.CODEFLASH_API_KEY }}
|
|
CODEFLASH_PR_NUMBER: ${{ github.event.number }}
|
|
COLUMNS: 110
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Set up Python
|
|
uses: astral-sh/setup-uv@v5
|
|
with:
|
|
python-version: "3.12"
|
|
|
|
- name: Install Project Dependencies
|
|
run: |
|
|
uv sync --refresh --isolated --active
|
|
uv pip uninstall codeflash
|
|
uv pip install pytest-asyncio
|
|
uv pip install git+https://github.com/codeflash-ai/codeflash@main
|
|
|
|
- name: Run Codeflash to optimize code
|
|
id: optimize_code
|
|
run: |
|
|
uv run --active codeflash --async
|