Skip to content

feat(ci) Run codeflash in on PRs modifying the Python CDK #44427

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Aug 26, 2024
Merged
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
44 changes: 44 additions & 0 deletions .github/workflows/cdk-codeflash.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Run Codeflash on CDK PR

on:
pull_request:
paths:
- airbyte-cdk/python/airbyte_cdk/**
workflow_dispatch:

defaults:
run:
working-directory: ./airbyte-cdk/python/airbyte_cdk

jobs:
optimize:
name:
Optimize new code in this PR
# Only run codeflash if
# 1. The contributor is not codeflash. To avoid infinite loops
# 2. The pull request is not from a forked repository
if: ${{ github.actor != 'codeflash-ai[bot]' && github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork != true}}
runs-on: ubuntu-latest
env:
CODEFLASH_API_KEY: ${{ secrets.CODEFLASH_API_KEY }}
CODEFLASH_PR_NUMBER: ${{ github.event.number }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install Airbyte CDK
id: install-airbyte-cdk
run: |
pip install --upgrade pip
pip install poetry
poetry install --all-extras --with dev
- name: Run Codeflash to optimize code
id: optimize_code
run: |
poetry env use python
poetry run codeflash
Loading