mirror of
https://github.com/codeflash-ai/codeflash.git
synced 2026-05-04 18:25:17 +00:00
* follow up * remove requirement * Delete uv.lock * refresh uv-lock * first pass * cleanup test_framework here * cleanup * code_review * cleanup tests * fix for E2E * fix tests dir missing * one more cleanup * cancel-in-progress * Revert "cancel-in-progress" This reverts commitf4bb9079cb. * not needed here * lower threshold and cleanup comments * debug * temp * debug Revert "debug" This reverts commit fc3655149486c8b980e245e97b8304232086f08d. fix(discover): Fix pytest discovery for futurehouse structure Revert "fix(discover): Fix pytest discovery for futurehouse structure" This reverts commit 40c48882b7413f5876af0e2e08d8f17a65bab091. Reapply "debug" This reverts commit c8297e57fbdca2462a8ca1199657748b8bc225e9. Revert "not needed here" This reverts commitdd2c5cdf76. Revert "lower threshold and cleanup comments" This reverts commit0e2f57e292. Reapply "lower threshold and cleanup comments" This reverts commit e3b24f4a2967551eca8a19f96bf6647b23acdbbc. Reapply "not needed here" This reverts commit aec32103c931ff6d57dfa0d012113c2cec5d37a7. Revert "Reapply "debug"" This reverts commit 77ab9f34f858a17fb29764c544769a0eb72ce7f0. Reapply "fix(discover): Fix pytest discovery for futurehouse structure" This reverts commit 506b94ab4fe17a7c8e0d458253812758cced3f22. feat(futurehouse): Make futurehouse structure pytest compatible * Revert "debug" This reverts commit271c5a37ec. * Revert "temp" This reverts commitb363acda1c. * Revert "debug" This reverts commitac29b6beb3. * just for now
72 lines
No EOL
2.6 KiB
YAML
72 lines
No EOL
2.6 KiB
YAML
name: E2E - Bubble Sort Unittest
|
|
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- '**' # Trigger for all paths
|
|
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref_name }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
bubble-sort-optimization-unittest:
|
|
# Dynamically determine if environment is needed only when workflow files change and contributor is external
|
|
environment: ${{ (github.event_name == 'workflow_dispatch' || (contains(toJSON(github.event.pull_request.files.*.filename), '.github/workflows/') && github.event.pull_request.user.login != 'misrasaurabh1' && github.event.pull_request.user.login != 'KRRT7')) && 'external-trusted-contributors' || '' }}
|
|
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
CODEFLASH_AIS_SERVER: prod
|
|
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: 40
|
|
CODEFLASH_END_TO_END: 1
|
|
steps:
|
|
- name: 🛎️ Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ github.event.pull_request.head.ref }}
|
|
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
|
fetch-depth: 0
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Validate PR
|
|
run: |
|
|
# Check for any workflow changes
|
|
if git diff --name-only "${{ github.event.pull_request.base.sha }}" "${{ github.event.pull_request.head.sha }}" | grep -q "^.github/workflows/"; then
|
|
echo "⚠️ Workflow changes detected."
|
|
|
|
# Get the PR author
|
|
AUTHOR="${{ github.event.pull_request.user.login }}"
|
|
echo "PR Author: $AUTHOR"
|
|
|
|
# Allowlist check
|
|
if [[ "$AUTHOR" == "misrasaurabh1" || "$AUTHOR" == "KRRT7" ]]; then
|
|
echo "✅ Authorized user ($AUTHOR). Proceeding."
|
|
elif [[ "${{ github.event.pull_request.state }}" == "open" ]]; then
|
|
echo "✅ PR triggered by 'pull_request_target' and is open. Assuming protection rules are in place. Proceeding."
|
|
else
|
|
echo "⛔ Unauthorized user ($AUTHOR) attempting to modify workflows. Exiting."
|
|
exit 1
|
|
fi
|
|
else
|
|
echo "✅ No workflow file changes detected. Proceeding."
|
|
fi
|
|
|
|
- name: Set up Python 3.11 for CLI
|
|
uses: astral-sh/setup-uv@v6
|
|
with:
|
|
python-version: 3.11.6
|
|
|
|
- name: Install dependencies (CLI)
|
|
run: |
|
|
uv sync
|
|
|
|
- name: Run Codeflash to optimize code
|
|
id: optimize_code
|
|
run: |
|
|
uv run python tests/scripts/end_to_end_test_bubblesort_unittest.py |