Skip to content

Commit 145043f

Browse files
authored
Merge pull request #2052 from codeflash-ai/ci/workflow-upgrades-and-fixes
ci: upgrade action versions, add uv cache, fix broken paths, DRY publish
2 parents 153097b + 7c4d98c commit 145043f

6 files changed

Lines changed: 88 additions & 114 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
e2e_js: ${{ github.event_name != 'pull_request' || steps.check.outputs.e2e_js == 'true' }}
3939
e2e_java: ${{ github.event_name != 'pull_request' || steps.check.outputs.e2e_java == 'true' }}
4040
steps:
41-
- uses: actions/checkout@v4
41+
- uses: actions/checkout@v6
4242
if: github.event_name == 'pull_request'
4343
with:
4444
fetch-depth: 0
@@ -127,7 +127,7 @@ jobs:
127127
env:
128128
PYTHONIOENCODING: utf-8
129129
steps:
130-
- uses: actions/checkout@v4
130+
- uses: actions/checkout@v6
131131
with:
132132
fetch-depth: 1
133133
token: ${{ secrets.GITHUB_TOKEN }}
@@ -136,13 +136,15 @@ jobs:
136136
uses: astral-sh/setup-uv@v8.0.0
137137
with:
138138
python-version: ${{ matrix.python-version }}
139+
enable-cache: true
139140

140141
- name: Install dependencies
141-
run: uv sync
142-
143-
- name: Install test-only dependencies (Python 3.9 and 3.13)
144-
if: matrix.python-version == '3.9' || matrix.python-version == '3.13'
145-
run: uv sync --group tests
142+
run: |
143+
if [[ "${{ matrix.python-version }}" == "3.9" || "${{ matrix.python-version }}" == "3.13" ]]; then
144+
uv sync --group tests
145+
else
146+
uv sync
147+
fi
146148
147149
- name: Unit tests
148150
run: uv run pytest tests/
@@ -155,18 +157,18 @@ jobs:
155157
if: needs.determine-changes.outputs.type_check == 'true'
156158
runs-on: ubuntu-latest
157159
steps:
158-
- uses: actions/checkout@v4
160+
- uses: actions/checkout@v6
159161
with:
160162
fetch-depth: 1
161163
token: ${{ secrets.GITHUB_TOKEN }}
162164

163165
- name: Install uv
164166
uses: astral-sh/setup-uv@v8.0.0
167+
with:
168+
enable-cache: true
165169

166170
- name: Install dependencies
167-
run: |
168-
uv venv --seed
169-
uv sync
171+
run: uv sync
170172

171173
- name: Run mypy
172174
run: uv run mypy --non-interactive --config-file pyproject.toml @mypy_allowlist.txt
@@ -184,11 +186,13 @@ jobs:
184186
permissions:
185187
contents: write
186188
steps:
187-
- uses: actions/checkout@v4
189+
- uses: actions/checkout@v6
188190
with:
189191
ref: ${{ github.head_ref }}
190192
fetch-depth: 0
191193
- uses: astral-sh/setup-uv@v8.0.0
194+
with:
195+
enable-cache: true
192196

193197
- name: Auto-fix formatting
194198
run: |
@@ -204,7 +208,7 @@ jobs:
204208
git commit -m "style: auto-format with ruff"
205209
git push
206210
207-
- uses: j178/prek-action@v1
211+
- uses: j178/prek-action@v2
208212
with:
209213
extra-args: '--from-ref origin/${{ github.base_ref }} --to-ref HEAD'
210214

@@ -260,7 +264,7 @@ jobs:
260264
RETRY_DELAY: 5
261265
CODEFLASH_END_TO_END: 1
262266
steps:
263-
- uses: actions/checkout@v4
267+
- uses: actions/checkout@v6
264268
with:
265269
ref: ${{ github.event.pull_request.head.ref || '' }}
266270
repository: ${{ github.event.pull_request.head.repo.full_name || '' }}
@@ -280,6 +284,7 @@ jobs:
280284
uses: astral-sh/setup-uv@v8.0.0
281285
with:
282286
python-version: 3.11.6
287+
enable-cache: true
283288

284289
- name: Install dependencies
285290
run: uv sync
@@ -348,7 +353,7 @@ jobs:
348353
EXPECTED_IMPROVEMENT_PCT: ${{ matrix.expected_improvement }}
349354
CODEFLASH_END_TO_END: 1
350355
steps:
351-
- uses: actions/checkout@v4
356+
- uses: actions/checkout@v6
352357
with:
353358
ref: ${{ github.event.pull_request.head.ref || '' }}
354359
repository: ${{ github.event.pull_request.head.repo.full_name || '' }}
@@ -365,7 +370,7 @@ jobs:
365370
pr_state: ${{ github.event.pull_request.state }}
366371

367372
- name: Set up Node.js
368-
uses: actions/setup-node@v4
373+
uses: actions/setup-node@v6
369374
with:
370375
node-version: '20'
371376
cache: 'npm'
@@ -387,6 +392,7 @@ jobs:
387392
uses: astral-sh/setup-uv@v8.0.0
388393
with:
389394
python-version: 3.11.6
395+
enable-cache: true
390396

391397
- name: Install dependencies
392398
run: uv sync
@@ -427,7 +433,7 @@ jobs:
427433
EXPECTED_IMPROVEMENT_PCT: ${{ matrix.expected_improvement }}
428434
CODEFLASH_END_TO_END: 1
429435
steps:
430-
- uses: actions/checkout@v4
436+
- uses: actions/checkout@v6
431437
with:
432438
ref: ${{ github.event.pull_request.head.ref || '' }}
433439
repository: ${{ github.event.pull_request.head.repo.full_name || '' }}
@@ -444,7 +450,7 @@ jobs:
444450
pr_state: ${{ github.event.pull_request.state }}
445451

446452
- name: Set up JDK 11
447-
uses: actions/setup-java@v4
453+
uses: actions/setup-java@v5
448454
with:
449455
java-version: '11'
450456
distribution: 'temurin'
@@ -454,6 +460,7 @@ jobs:
454460
uses: astral-sh/setup-uv@v8.0.0
455461
with:
456462
python-version: 3.11.6
463+
enable-cache: true
457464

458465
- name: Install dependencies
459466
run: uv sync

.github/workflows/claude.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,28 +51,30 @@ jobs:
5151
actions: read
5252
steps:
5353
- name: Checkout repository
54-
uses: actions/checkout@v4
54+
uses: actions/checkout@v6
5555
with:
5656
fetch-depth: 0
5757
ref: ${{ github.event.pull_request.head.ref || github.ref }}
5858

5959
- name: Install uv
6060
uses: astral-sh/setup-uv@v8.0.0
61+
with:
62+
enable-cache: true
6163

6264
- name: Install dependencies
6365
run: |
6466
uv venv --seed
6567
uv sync
6668
6769
- name: Configure AWS Credentials
68-
uses: aws-actions/configure-aws-credentials@v4
70+
uses: aws-actions/configure-aws-credentials@v6
6971
with:
7072
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
7173
aws-region: ${{ secrets.AWS_REGION }}
7274

7375
- name: Run Claude Code
7476
id: claude
75-
uses: anthropics/claude-code-action@v1.0.89
77+
uses: anthropics/claude-code-action@v1
7678
with:
7779
use_bedrock: "true"
7880
use_sticky_comment: true
@@ -311,28 +313,30 @@ jobs:
311313
fi
312314
313315
- name: Checkout repository
314-
uses: actions/checkout@v4
316+
uses: actions/checkout@v6
315317
with:
316318
fetch-depth: 0
317319
ref: ${{ steps.pr-ref.outputs.ref }}
318320

319321
- name: Install uv
320322
uses: astral-sh/setup-uv@v8.0.0
323+
with:
324+
enable-cache: true
321325

322326
- name: Install dependencies
323327
run: |
324328
uv venv --seed
325329
uv sync
326330
327331
- name: Configure AWS Credentials
328-
uses: aws-actions/configure-aws-credentials@v4
332+
uses: aws-actions/configure-aws-credentials@v6
329333
with:
330334
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
331335
aws-region: ${{ secrets.AWS_REGION }}
332336

333337
- name: Run Claude Code
334338
id: claude
335-
uses: anthropics/claude-code-action@v1.0.89
339+
uses: anthropics/claude-code-action@v1
336340
with:
337341
use_bedrock: "true"
338342
claude_args: '--model us.anthropic.claude-sonnet-4-6 --allowedTools "Read,Edit,Write,Glob,Grep,Bash(git status*),Bash(git diff*),Bash(git add *),Bash(git commit *),Bash(git push*),Bash(git log*),Bash(git merge*),Bash(git fetch*),Bash(git checkout*),Bash(git branch*),Bash(uv run prek *),Bash(prek *),Bash(uv run ruff *),Bash(uv run pytest *),Bash(uv run mypy *),Bash(uv run coverage *),Bash(gh pr comment*),Bash(gh pr view*),Bash(gh pr diff*),Bash(gh pr merge*),Bash(gh pr close*)"'

.github/workflows/codeflash-optimize.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,15 @@ jobs:
2626
COLUMNS: 110
2727
steps:
2828
- name: 🛎️ Checkout
29-
uses: actions/checkout@v4
29+
uses: actions/checkout@v6
3030
with:
3131
fetch-depth: 0
3232

3333
- name: 🐍 Set up Python 3.11 for CLI
3434
uses: astral-sh/setup-uv@v8.0.0
3535
with:
3636
python-version: 3.11.6
37+
enable-cache: true
3738

3839
- name: 📦 Install dependencies (CLI)
3940
run: |

.github/workflows/codeflash.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
pull_request:
55
paths:
66
# So that this workflow only runs when code within the target module is modified
7-
- 'code_to_optimize_js_esm/**'
7+
- 'code_to_optimize/js/code_to_optimize_js_esm/**'
88
workflow_dispatch:
99

1010
concurrency:
@@ -23,19 +23,20 @@ jobs:
2323
CODEFLASH_API_KEY: ${{ secrets.CODEFLASH_API_KEY }}
2424
defaults:
2525
run:
26-
working-directory: ./code_to_optimize_js_esm
26+
working-directory: ./code_to_optimize/js/code_to_optimize_js_esm
2727
steps:
2828
- name: 🛎️ Checkout
29-
uses: actions/checkout@v4
29+
uses: actions/checkout@v6
3030
with:
3131
fetch-depth: 0
3232
- name: 🟢 Setup Node.js
33-
uses: actions/setup-node@v4
33+
uses: actions/setup-node@v6
3434
with:
3535
node-version: '22'
3636
cache: 'npm'
37+
cache-dependency-path: code_to_optimize/js/code_to_optimize_js_esm/package-lock.json
3738
- name: 📦 Install Dependencies
3839
run: npm ci
39-
40+
4041
- name: ⚡️ Codeflash Optimization
4142
run: npx codeflash

.github/workflows/label-workflow-changes.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
pull-requests: write
1414
steps:
1515
- name: Label PR with workflow changes
16-
uses: actions/github-script@v6
16+
uses: actions/github-script@v7
1717
with:
1818
script: |
1919
const labelName = 'workflow-modified';

0 commit comments

Comments
 (0)