Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/codeflash.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Codeflash

on:
pull_request:
paths:
# So that this workflow only runs when code within the target module is modified
- 'src/**'
workflow_dispatch:

concurrency:
# Any new push to the PR will cancel the previous run, so that only the latest code is optimized
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true


jobs:
optimize:
name: Optimize new Python code
# Don't run codeflash on codeflash-ai[bot] commits, prevent duplicate optimizations
if: ${{ github.actor != 'codeflash-ai[bot]' }}
runs-on: ubuntu-latest
env:
CODEFLASH_API_KEY: ${{ secrets.CODEFLASH_API_KEY }}

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python 3.9
uses: actions/setup-python@v5.6.0
with:
python-version: '3.9'
architecture: 'x64'
- name: Install system packages required for building C extensions
run: |
sudo apt-get update
sudo apt-get install -y build-essential python3-dev libssl-dev libyaml-dev zlib1g-dev pkg-config
- name: Upgrade pip, setuptools and wheel
run: python -m pip install --upgrade pip setuptools wheel
- name: Install Python dependencies
run: |
python -m pip install -r requirements.txt
- name: ⚡️Codeflash Optimization
run: codeflash
Loading