1- name : CodeFlash
1+ name : Codeflash
22
33on :
44 pull_request :
55 paths :
6- - " **"
6+ # So that this workflow only runs when code within the target module is modified
7+ - " skyvern/**"
78 workflow_dispatch :
89
910concurrency :
11+ # Any new push to the PR will cancel the previous run, so that only the latest code is optimized
1012 group : ${{ github.workflow }}-${{ github.ref }}
1113 cancel-in-progress : true
1214
1315jobs :
1416 optimize :
15- name : Optimize new code in this PR
17+ name : Optimize new Python code in this PR
18+ # Don't run codeflash on codeflash-ai[bot] commits, prevent duplicate optimizations
1619 if : ${{ github.actor != 'codeflash-ai[bot]' }}
1720 runs-on : ubuntu-latest
1821 env :
19- CODEFLASH_AIS_SERVER : prod
20- POSTHOG_API_KEY : ${{ secrets.POSTHOG_API_KEY }}
2122 CODEFLASH_API_KEY : ${{ secrets.CODEFLASH_API_KEY }}
2223 CODEFLASH_PR_NUMBER : ${{ github.event.number }}
23- COLUMNS : 110
24+
2425 steps :
2526 - uses : actions/checkout@v4
2627 with :
2728 fetch-depth : 0
28-
29- - name : Set up Python 3.11 for CLI
30- uses : astral-sh/setup-uv@v5
29+ - name : Set up Python
30+ uses : actions/setup-python@v5
3131 with :
32- python-version : 3.11.6
33-
34- - name : Install dependencies (CLI)
32+ python-version : " 3.11"
33+ - name : Install Project Dependencies
3534 run : |
36- uv tool install poetry
37- uv venv
38- source .venv/bin/activate
39- poetry install --with dev
40-
35+ python -m pip install --upgrade pip
36+ pip install poetry
37+ poetry install --all-extras
38+ poetry add codeflash
39+ - name : create test dir
40+ run : |
41+ mkdir -p codeflash-tests
4142 - name : Run Codeflash to optimize code
42- id : optimize_code
4343 run : |
44- source .venv/bin/activate
45- poetry run codeflash
44+ poetry env use python
45+ poetry run codeflash
46+ - name : remove test dir
47+ run : |
48+ rm -rf codeflash-tests
0 commit comments