Skip to content

Commit 6e40ff8

Browse files
Add CodeFlash GitHub Actions workflow
1 parent 7d41365 commit 6e40ff8

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

.github/workflows/codeflash.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Codeflash
2+
3+
on:
4+
pull_request:
5+
paths:
6+
# So that this workflow only runs when code within the target module is modified
7+
- 'code_to_optimize_js_esm/**'
8+
workflow_dispatch:
9+
10+
concurrency:
11+
# Any new push to the PR will cancel the previous run, so that only the latest code is optimized
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
16+
jobs:
17+
optimize:
18+
name: Optimize new code
19+
# Don't run codeflash on codeflash-ai[bot] commits, prevent duplicate optimizations
20+
if: ${{ github.actor != 'codeflash-ai[bot]' }}
21+
runs-on: ubuntu-latest
22+
env:
23+
CODEFLASH_API_KEY: ${{ secrets.CODEFLASH_API_KEY }}
24+
defaults:
25+
run:
26+
working-directory: ./code_to_optimize_js_esm
27+
steps:
28+
- name: 🛎️ Checkout
29+
uses: actions/checkout@v4
30+
with:
31+
fetch-depth: 0
32+
- name: 🟢 Setup Node.js
33+
uses: actions/setup-node@v4
34+
with:
35+
node-version: '22'
36+
cache: 'npm'
37+
- name: 📦 Install Dependencies
38+
run: npm ci
39+
40+
- name: ⚡️ Codeflash Optimization
41+
run: npx codeflash

0 commit comments

Comments
 (0)