From 83496493d70a02e821aeb52d42486de67769d6f1 Mon Sep 17 00:00:00 2001 From: Saurabh Misra Date: Mon, 24 Mar 2025 15:11:56 -0700 Subject: [PATCH] Make codeflash github actions cooler? --- .github/workflows/codeflash-optimize.yaml | 11 ++++++----- codeflash/cli_cmds/cmd_init.py | 4 ++-- codeflash/cli_cmds/workflows/codeflash-optimize.yaml | 9 +++++---- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/.github/workflows/codeflash-optimize.yaml b/.github/workflows/codeflash-optimize.yaml index d08fed61e..d04b1e884 100644 --- a/.github/workflows/codeflash-optimize.yaml +++ b/.github/workflows/codeflash-optimize.yaml @@ -12,7 +12,7 @@ concurrency: jobs: optimize: - name: Optimize new code in this PR + name: Optimize new Python code if: ${{ github.actor != 'codeflash-ai[bot]' }} runs-on: ubuntu-latest env: @@ -22,23 +22,24 @@ jobs: CODEFLASH_PR_NUMBER: ${{ github.event.number }} COLUMNS: 110 steps: - - uses: actions/checkout@v4 + - name: 🛎️ Checkout + uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Set up Python 3.11 for CLI + - name: 🐍 Set up Python 3.11 for CLI uses: astral-sh/setup-uv@v5 with: python-version: 3.11.6 - - name: Install dependencies (CLI) + - name: 📦 Install dependencies (CLI) run: | uv tool install poetry uv venv source .venv/bin/activate poetry install --with dev - - name: Run Codeflash to optimize code + - name: ⚡️Codeflash Optimization id: optimize_code run: | source .venv/bin/activate diff --git a/codeflash/cli_cmds/cmd_init.py b/codeflash/cli_cmds/cmd_init.py index d6140a6fd..ab0d06dbb 100644 --- a/codeflash/cli_cmds/cmd_init.py +++ b/codeflash/cli_cmds/cmd_init.py @@ -504,11 +504,11 @@ def get_dependency_manager_installation_string(dep_manager: DependencyManager) - py_version = sys.version_info python_version_string = f"'{py_version.major}.{py_version.minor}'" if dep_manager == DependencyManager.UV: - return """name: Setup UV + return """name: 🐍 Setup UV uses: astral-sh/setup-uv@v4 with: enable-cache: true""" - return f"""name: Set up Python + return f"""name: 🐍 Set up Python uses: actions/setup-python@v5 with: python-version: {python_version_string}""" diff --git a/codeflash/cli_cmds/workflows/codeflash-optimize.yaml b/codeflash/cli_cmds/workflows/codeflash-optimize.yaml index 21afce69b..ccf2ec382 100644 --- a/codeflash/cli_cmds/workflows/codeflash-optimize.yaml +++ b/codeflash/cli_cmds/workflows/codeflash-optimize.yaml @@ -15,7 +15,7 @@ concurrency: jobs: optimize: - name: Optimize new Python code in this PR + 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 @@ -24,11 +24,12 @@ jobs: CODEFLASH_PR_NUMBER: ${{ github.event.number }} {{ working_directory }} steps: - - uses: actions/checkout@v4 + - name: 🛎️ Checkout + uses: actions/checkout@v4 with: fetch-depth: 0 - {{ setup_python_dependency_manager }} - - name: Install Project Dependencies + - name: 📦 Install Dependencies run: {{ install_dependencies_command }} - - name: Run Codeflash to optimize code + - name: ⚡️Codeflash Optimization run: {{ codeflash_command }}