@@ -61,26 +61,39 @@ jobs:
6161 fi
6262 }
6363
64- # Unit tests: code + test infra + java + packages + build config
64+ # Unit tests: code + test infra + packages + build config
6565 check_paths unit_tests \
66- 'codeflash/' 'codeflash-benchmark/' 'codeflash-java-runtime/' \
66+ 'codeflash/' 'codeflash-benchmark/' \
6767 'tests/' 'packages/' 'pyproject.toml' 'uv.lock'
6868
6969 # Type checking: code + build config + mypy config
7070 check_paths type_check \
7171 'codeflash/' 'pyproject.toml' 'uv.lock' 'mypy_allowlist.txt'
7272
73- # E2E tests: code + tests + build config
73+ # E2E tests: Python pipeline + tests + build config (excludes java/ and javascript/)
7474 check_paths e2e \
75- 'codeflash/' 'tests/' 'pyproject.toml' 'uv.lock'
76-
77- # JS E2E tests: JS packages changed
75+ 'codeflash/*.py' \
76+ 'codeflash/api/' 'codeflash/benchmarking/' 'codeflash/cli_cmds/' \
77+ 'codeflash/code_utils/' 'codeflash/discovery/' 'codeflash/github/' \
78+ 'codeflash/languages/python/' 'codeflash/languages/*.py' \
79+ 'codeflash/lsp/' 'codeflash/models/' 'codeflash/optimization/' \
80+ 'codeflash/picklepatch/' 'codeflash/result/' 'codeflash/setup/' \
81+ 'codeflash/telemetry/' 'codeflash/tracing/' 'codeflash/verification/' \
82+ 'tests/' 'pyproject.toml' 'uv.lock'
83+
84+ # JS E2E tests: JS language support + shared pipeline + packages
7885 check_paths e2e_js \
79- 'packages/'
86+ 'codeflash/languages/javascript/' 'codeflash/languages/base.py' \
87+ 'codeflash/languages/registry.py' 'codeflash/optimization/' \
88+ 'codeflash/verification/' 'packages/' \
89+ 'tests/scripts/end_to_end_test_js*'
8090
81- # Java E2E tests: java runtime or java test fixtures changed
91+ # Java E2E tests: Java language support + shared pipeline + runtime
8292 check_paths e2e_java \
83- 'codeflash-java-runtime/' 'code_to_optimize/java/'
93+ 'codeflash/languages/java/' 'codeflash/languages/base.py' \
94+ 'codeflash/languages/registry.py' 'codeflash/optimization/' \
95+ 'codeflash/verification/' 'codeflash-java-runtime/' \
96+ 'code_to_optimize/java/' 'tests/scripts/end_to_end_test_java*'
8497 env :
8598 MERGE_BASE : ${{ steps.merge_base.outputs.sha }}
8699
@@ -108,29 +121,15 @@ jobs:
108121 python-version : " 3.14"
109122 - os : windows-latest
110123 python-version : " 3.13"
111- continue-on-error : true
112124 runs-on : ${{ matrix.os }}
113125 env :
114126 PYTHONIOENCODING : utf-8
115127 steps :
116128 - uses : actions/checkout@v4
117129 with :
118- fetch-depth : 0
130+ fetch-depth : 1
119131 token : ${{ secrets.GITHUB_TOKEN }}
120132
121- - name : Set up JDK 11
122- uses : actions/setup-java@v4
123- with :
124- java-version : ' 11'
125- distribution : ' temurin'
126- cache : maven
127-
128- - name : Build codeflash-runtime JAR
129- run : |
130- cd codeflash-java-runtime
131- mvn clean package -q -DskipTests
132- mvn install -q -DskipTests
133-
134133 - name : Install uv
135134 uses : astral-sh/setup-uv@v8.0.0
136135 with :
@@ -156,7 +155,7 @@ jobs:
156155 steps :
157156 - uses : actions/checkout@v4
158157 with :
159- fetch-depth : 0
158+ fetch-depth : 1
160159 token : ${{ secrets.GITHUB_TOKEN }}
161160
162161 - name : Install uv
@@ -180,14 +179,32 @@ jobs:
180179 && (needs.determine-changes.outputs.e2e == 'true'
181180 || needs.determine-changes.outputs.e2e_js == 'true')
182181 runs-on : ubuntu-latest
182+ permissions :
183+ contents : write
183184 steps :
184185 - uses : actions/checkout@v4
185186 with :
187+ ref : ${{ github.head_ref }}
186188 fetch-depth : 0
187189 - uses : astral-sh/setup-uv@v8.0.0
190+
191+ - name : Auto-fix formatting
192+ run : |
193+ uv run ruff check --fix . || true
194+ uv run ruff format .
195+
196+ - name : Commit and push fixes
197+ run : |
198+ git diff --quiet && exit 0
199+ git config user.name "github-actions[bot]"
200+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
201+ git add -u
202+ git commit -m "style: auto-format with ruff"
203+ git push
204+
188205 - uses : j178/prek-action@v1
189206 with :
190- extra-args : ' --from-ref origin/${{ github.base_ref }} --to-ref ${{ github.sha }} '
207+ extra-args : ' --from-ref origin/${{ github.base_ref }} --to-ref HEAD '
191208
192209 # ---------------------------------------------------------------------------
193210 # E2E tests — only on pull_request and workflow_dispatch (not push to main)
@@ -231,7 +248,6 @@ jobs:
231248 - name : init-optimization
232249 script : end_to_end_test_init_optimization.py
233250 expected_improvement : 10
234- name : ${{ matrix.name }}
235251 environment : ${{ (github.event_name == 'workflow_dispatch' || (contains(toJSON(github.event.pull_request.files.*.filename), '.github/workflows/') && github.event.pull_request.user.login != 'misrasaurabh1' && github.event.pull_request.user.login != 'KRRT7')) && 'external-trusted-contributors' || '' }}
236252 runs-on : ubuntu-latest
237253 env :
@@ -251,21 +267,12 @@ jobs:
251267
252268 - name : Validate PR
253269 if : github.event_name == 'pull_request'
254- run : |
255- if git diff --name-only "${{ github.event.pull_request.base.sha }}" "${{ github.event.pull_request.head.sha }}" | grep -q "^.github/workflows/"; then
256- echo "Workflow changes detected."
257- AUTHOR="${{ github.event.pull_request.user.login }}"
258- if [[ "$AUTHOR" == "misrasaurabh1" || "$AUTHOR" == "KRRT7" ]]; then
259- echo "Authorized user ($AUTHOR). Proceeding."
260- elif [[ "${{ github.event.pull_request.state }}" == "open" ]]; then
261- echo "PR is open. Protection rules in place. Proceeding."
262- else
263- echo "Unauthorized user ($AUTHOR). Exiting."
264- exit 1
265- fi
266- else
267- echo "No workflow file changes. Proceeding."
268- fi
270+ uses : ./.github/actions/validate-pr
271+ with :
272+ base_sha : ${{ github.event.pull_request.base.sha }}
273+ head_sha : ${{ github.event.pull_request.head.sha }}
274+ author : ${{ github.event.pull_request.user.login }}
275+ pr_state : ${{ github.event.pull_request.state }}
269276
270277 - name : Install uv
271278 uses : astral-sh/setup-uv@v8.0.0
@@ -309,8 +316,7 @@ jobs:
309316 e2e-js :
310317 needs : determine-changes
311318 if : >-
312- (needs.determine-changes.outputs.e2e == 'true'
313- || needs.determine-changes.outputs.e2e_js == 'true')
319+ needs.determine-changes.outputs.e2e_js == 'true'
314320 && github.event_name != 'push'
315321 strategy :
316322 fail-fast : false
@@ -328,7 +334,6 @@ jobs:
328334 script : end_to_end_test_js_ts_class.py
329335 js_project_dir : code_to_optimize/js/code_to_optimize_ts
330336 expected_improvement : 30
331- name : ${{ matrix.name }}
332337 environment : ${{ (github.event_name == 'workflow_dispatch' || (contains(toJSON(github.event.pull_request.files.*.filename), '.github/workflows/') && github.event.pull_request.user.login != 'misrasaurabh1' && github.event.pull_request.user.login != 'KRRT7')) && 'external-trusted-contributors' || '' }}
333338 runs-on : ubuntu-latest
334339 env :
@@ -350,21 +355,12 @@ jobs:
350355
351356 - name : Validate PR
352357 if : github.event_name == 'pull_request'
353- run : |
354- if git diff --name-only "${{ github.event.pull_request.base.sha }}" "${{ github.event.pull_request.head.sha }}" | grep -q "^.github/workflows/"; then
355- echo "Workflow changes detected."
356- AUTHOR="${{ github.event.pull_request.user.login }}"
357- if [[ "$AUTHOR" == "misrasaurabh1" || "$AUTHOR" == "KRRT7" ]]; then
358- echo "Authorized user ($AUTHOR). Proceeding."
359- elif [[ "${{ github.event.pull_request.state }}" == "open" ]]; then
360- echo "PR is open. Protection rules in place. Proceeding."
361- else
362- echo "Unauthorized user ($AUTHOR). Exiting."
363- exit 1
364- fi
365- else
366- echo "No workflow file changes. Proceeding."
367- fi
358+ uses : ./.github/actions/validate-pr
359+ with :
360+ base_sha : ${{ github.event.pull_request.base.sha }}
361+ head_sha : ${{ github.event.pull_request.head.sha }}
362+ author : ${{ github.event.pull_request.user.login }}
363+ pr_state : ${{ github.event.pull_request.state }}
368364
369365 - name : Set up Node.js
370366 uses : actions/setup-node@v4
@@ -396,8 +392,7 @@ jobs:
396392 e2e-java :
397393 needs : determine-changes
398394 if : >-
399- (needs.determine-changes.outputs.e2e == 'true'
400- || needs.determine-changes.outputs.e2e_java == 'true')
395+ needs.determine-changes.outputs.e2e_java == 'true'
401396 && github.event_name != 'push'
402397 strategy :
403398 fail-fast : false
@@ -414,7 +409,6 @@ jobs:
414409 script : end_to_end_test_java_void_optimization.py
415410 expected_improvement : 70
416411 remove_git : true
417- name : ${{ matrix.name }}
418412 environment : ${{ (github.event_name == 'workflow_dispatch' || (contains(toJSON(github.event.pull_request.files.*.filename), '.github/workflows/') && github.event.pull_request.user.login != 'misrasaurabh1' && github.event.pull_request.user.login != 'KRRT7')) && 'external-trusted-contributors' || '' }}
419413 runs-on : ubuntu-latest
420414 env :
@@ -436,21 +430,12 @@ jobs:
436430
437431 - name : Validate PR
438432 if : github.event_name == 'pull_request'
439- run : |
440- if git diff --name-only "${{ github.event.pull_request.base.sha }}" "${{ github.event.pull_request.head.sha }}" | grep -q "^.github/workflows/"; then
441- echo "Workflow changes detected."
442- AUTHOR="${{ github.event.pull_request.user.login }}"
443- if [[ "$AUTHOR" == "misrasaurabh1" || "$AUTHOR" == "KRRT7" ]]; then
444- echo "Authorized user ($AUTHOR). Proceeding."
445- elif [[ "${{ github.event.pull_request.state }}" == "open" ]]; then
446- echo "PR is open. Protection rules in place. Proceeding."
447- else
448- echo "Unauthorized user ($AUTHOR). Exiting."
449- exit 1
450- fi
451- else
452- echo "No workflow file changes. Proceeding."
453- fi
433+ uses : ./.github/actions/validate-pr
434+ with :
435+ base_sha : ${{ github.event.pull_request.base.sha }}
436+ head_sha : ${{ github.event.pull_request.head.sha }}
437+ author : ${{ github.event.pull_request.user.login }}
438+ pr_state : ${{ github.event.pull_request.state }}
454439
455440 - name : Set up JDK 11
456441 uses : actions/setup-java@v4
0 commit comments