Skip to content

Commit 81638d3

Browse files
committed
push uncommitted files
1 parent 6980d4e commit 81638d3

2 files changed

Lines changed: 52 additions & 0 deletions

File tree

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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 }}

tests/conftest.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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()

0 commit comments

Comments
 (0)