File tree Expand file tree Collapse file tree
codeflash/cli_cmds/workflows Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Codeflash
2+
3+ on :
4+ pull_request :
5+ paths :
6+ # So that this workflow only runs when code within the target module is modified
7+ - ' {{ codeflash_module_path }}'
8+ workflow_dispatch :
9+
10+ concurrency :
11+ # Any new push to the PR will cancel the previous run, so that only the latest code is optimized
12+ group : ${{ github.workflow }}-${{ github.ref }}
13+ cancel-in-progress : true
14+
15+
16+ jobs :
17+ optimize :
18+ name : Optimize new code
19+ # Don't run codeflash on codeflash-ai[bot] commits, prevent duplicate optimizations
20+ if : ${{ github.actor != 'codeflash-ai[bot]' }}
21+ runs-on : ubuntu-latest
22+ env :
23+ CODEFLASH_API_KEY : ${{ secrets.CODEFLASH_API_KEY }}
24+ {{ working_directory }}
25+ steps :
26+ - name : 🛎️ Checkout
27+ uses : actions/checkout@v4
28+ with :
29+ fetch-depth : 0
30+ {{ setup_runtime_steps }}
31+ - name : 📦 Install Dependencies
32+ run : {{ install_dependencies_command }}
33+ {{ install_codeflash_step }}
34+ - name : ⚡️ Codeflash Optimization
35+ run : {{ codeflash_command }}
Original file line number Diff line number Diff line change 1+ """Pytest configuration and fixtures for codeflash tests."""
2+
3+ import pytest
4+
5+ from codeflash .languages import reset_current_language
6+
7+
8+ @pytest .fixture (autouse = True )
9+ def set_python_language ():
10+ """Ensure the current language is set to Python for all tests.
11+
12+ This fixture runs automatically before each test to ensure a clean language state.
13+ """
14+ reset_current_language ()
15+ yield
16+ # Reset again after test to clean up any changes
17+ reset_current_language ()
You can’t perform that action at this time.
0 commit comments