mirror of
https://github.com/codeflash-ai/codeflash-internal.git
synced 2026-05-04 18:25:18 +00:00
Signed-off-by: Saurabh Misra <misra.saurabh1@gmail.com> Co-authored-by: saga4 <saga4@codeflashs-MacBook-Air.local> Co-authored-by: Sarthak Agarwal <sarthak.saga@gmail.com> Co-authored-by: Mohamed Ashraf <mohamedashrraf222@gmail.com> Co-authored-by: Aseem Saxena <aseem.bits@gmail.com>
110 lines
3 KiB
YAML
110 lines
3 KiB
YAML
name: end-to-end-test
|
|
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- "django/aiservice/**"
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
pull-requests: read
|
|
|
|
jobs:
|
|
check-changes:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
should_run: ${{ steps.filter.outputs.relevant == 'true' || github.event_name == 'workflow_dispatch' }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Check which projects changed
|
|
uses: dorny/paths-filter@v2
|
|
id: filter
|
|
with:
|
|
filters: |
|
|
relevant:
|
|
- 'django/aiservice/**'
|
|
- '.github/workflows/end-to-end-test-futurehouse.yaml'
|
|
|
|
skip:
|
|
needs: check-changes
|
|
if: ${{ needs.check-changes.outputs.should_run != 'true' }}
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Skip test
|
|
run: echo "No relevant changes detected, skipping end-to-end test"
|
|
- name: Mark as success
|
|
run: exit 0
|
|
|
|
futurehouse-structure:
|
|
needs: check-changes
|
|
if: ${{ needs.check-changes.outputs.should_run == 'true' }}
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
CODEFLASH_AIS_SERVER: local
|
|
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
|
|
OPENAI_API_TYPE: ${{ secrets.OPENAI_API_TYPE }}
|
|
OPENAI_API_BASE: ${{ secrets.OPENAI_API_BASE }}
|
|
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
|
DATABASE_URL: ${{ secrets.DATABASE_URL }}
|
|
POSTHOG_API_KEY: ${{ secrets.POSTHOG_API_KEY }}
|
|
CODEFLASH_API_KEY: ${{ secrets.CODEFLASH_API_KEY }}
|
|
COLUMNS: 110
|
|
MAX_RETRIES: 3
|
|
RETRY_DELAY: 5
|
|
EXPECTED_IMPROVEMENT_PCT: 10
|
|
CODEFLASH_END_TO_END: 1
|
|
steps:
|
|
- name: Check out codeflash-internal repo
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Set up Python 3.12 for AI Server
|
|
uses: astral-sh/setup-uv@v7
|
|
with:
|
|
python-version: "3.12"
|
|
|
|
- name: Install dependencies for Django server
|
|
run: |
|
|
cd ./django/aiservice
|
|
uv sync
|
|
|
|
- name: Start Django server
|
|
run: |
|
|
cd ./django/aiservice
|
|
uv run python manage.py runserver localhost:8000 >> server.log 2>&1 &
|
|
|
|
- name: Clone codeflash repo
|
|
run: |
|
|
cd ..
|
|
git clone https://github.com/codeflash-ai/codeflash.git
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Set up Python 3.11 for CLI
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.11.6"
|
|
|
|
- name: Install dependencies (CLI)
|
|
run: |
|
|
cd ../codeflash
|
|
uv sync
|
|
uv add sqlalchemy
|
|
|
|
- name: Run Codeflash to optimize code
|
|
id: optimize_code
|
|
run: |
|
|
cd ../codeflash
|
|
uv run python tests/scripts/end_to_end_test_futurehouse.py
|
|
|
|
- name: Display AI Server logs
|
|
if: always()
|
|
run: |
|
|
cd ./django/aiservice
|
|
cat server.log
|