Codeflash GHA ⚡ (#1928)
This commit is contained in:
43
.github/workflows/codeflash.yaml
vendored
Normal file
43
.github/workflows/codeflash.yaml
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
name: Codeflash
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
# So that this workflow only runs when code within the target module is modified
|
||||
- "skyvern/**"
|
||||
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 in this PR
|
||||
# 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 }}
|
||||
CODEFLASH_PR_NUMBER: ${{ github.event.number }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.11"
|
||||
- name: Install Project Dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install poetry
|
||||
poetry install --all-extras
|
||||
poetry add codeflash
|
||||
|
||||
- name: Run Codeflash to optimize code
|
||||
run: |
|
||||
poetry env use python
|
||||
poetry run codeflash
|
||||
@@ -135,3 +135,11 @@ plugins = "sqlalchemy.ext.mypy.plugin"
|
||||
|
||||
[tool.poetry.scripts]
|
||||
skyvern = "skyvern.cli.commands:app"
|
||||
|
||||
[tool.codeflash]
|
||||
# All paths are relative to this pyproject.toml's directory.
|
||||
module-root = "skyvern"
|
||||
tests-root = "tests"
|
||||
test-framework = "pytest"
|
||||
ignore-paths = ["skyvern/client"]
|
||||
formatter-cmds = ["ruff check --exit-zero --fix $file", "ruff format $file"]
|
||||
Reference in New Issue
Block a user