codeflash/.github/workflows/codeflash.yaml
Kevin Turcios be4c459d01 ci: upgrade action versions, add uv cache, fix broken paths, DRY publish
- Bump actions/checkout v4/v5 → v6, setup-node v4 → v6, setup-java v4 → v5,
  prek-action v1 → v2, github-script v6 → v7, aws-credentials v4 → v6,
  claude-code-action v1.0.89 → v1
- Add enable-cache: true to all astral-sh/setup-uv steps
- Remove redundant uv venv --seed (uv sync creates venvs automatically)
- Merge double uv sync steps in unit-tests into single conditional
- Fix codeflash.yaml: broken path filter and working-directory
- Consolidate duplicate publish jobs into a single matrix job
- Remove generate_release_notes overridden by manual body
2026-04-09 22:06:41 -05:00

42 lines
1.2 KiB
YAML

name: Codeflash
on:
pull_request:
paths:
# So that this workflow only runs when code within the target module is modified
- 'code_to_optimize/js/code_to_optimize_js_esm/**'
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 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 }}
defaults:
run:
working-directory: ./code_to_optimize/js/code_to_optimize_js_esm
steps:
- name: 🛎️ Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: 🟢 Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '22'
cache: 'npm'
cache-dependency-path: code_to_optimize/js/code_to_optimize_js_esm/package-lock.json
- name: 📦 Install Dependencies
run: npm ci
- name: ⚡️ Codeflash Optimization
run: npx codeflash