ci: optimize workflow for performance and efficiency#1
ci: optimize workflow for performance and efficiency#1
Conversation
Agent-Logs-Url: https://github.com/insop/RustPython/sessions/b7e469e0-7911-4458-82eb-dc9388926716 Co-authored-by: insop <1240382+insop@users.noreply.github.com>
|
Check the WASM package and demo |
Agent-Logs-Url: https://github.com/insop/RustPython/sessions/50324ab5-3a09-45b4-9204-8b9538494734 Co-authored-by: insop <1240382+insop@users.noreply.github.com>
|
Fixed in |
|
Still failing? |
…acks proper releases) Agent-Logs-Url: https://github.com/insop/RustPython/sessions/4e47da79-dfd3-4b5d-b09b-4ebdf856f13d Co-authored-by: insop <1240382+insop@users.noreply.github.com>
Fixed in |
Several CI inefficiencies: missing timeouts on two jobs, no pip caching, release builds sharing a debug cache key, env polluter loop running unconditionally on empty lists, and commented-out dead code.
Triggers
paths-ignore(**.md,docs/**,LICENSE) topushandpull_requestto skip full CI on doc-only changesTimeouts
lint: addtimeout-minutes: 15cargo_check: addtimeout-minutes: 30Caching
snippets_cpythonrust-cache: addshared-key: release-${{ matrix.os }}to isolate release artifacts from debug cachesnippets_cpython+wasm: addcache: 'pip'withcache-dependency-pathtoactions/setup-pythonsnippets_cpythonenv polluter stepSkip entirely when the list is empty (currently always the case):
Dead code
Remove commented-out tkinter install/build steps (
rust_tests) and Redox compilation steps (cargo_check).Original prompt
Optimize
.github/workflows/ci.yamlfor performance and efficiencyApply the following optimizations to the CI workflow at
.github/workflows/ci.yaml:1. Add
paths-ignoreto triggersAdd
paths-ignorefor documentation-only changes (**.md,docs/**,LICENSE) to bothpushandpull_requesttriggers so the full CI suite is skipped for doc-only changes.2. Add missing
timeout-minutestolintandcargo_checkjobslint: addtimeout-minutes: 15cargo_check: addtimeout-minutes: 303. Separate release cache key in
snippets_cpythonIn the
snippets_cpythonjob, theSwatinem/rust-cachestep should use ashared-keyto distinguish release builds from debug builds:4. Cache pip dependencies in
snippets_cpythonIn the
snippets_cpythonjob, add pip caching to theactions/setup-pythonstep:5. Skip env polluter loop when list is empty
Add a condition to the "run cpython tests to check if env polluters have stopped polluting" step so it is skipped when
matrix.env_polluting_testsis empty:6. Remove commented-out code blocks
Remove the following commented-out blocks that add cognitive overhead:
rust_testsjobcargo_checkjob7. Use
browser-actions/setup-geckodriverinstead of manual wget in thewasmjobReplace the manual geckodriver download:
With a proper action (use a recent pinned version of
browser-actions/setup-geckodriver):Also update the test step that references geckodriver to use the action's path. The
driver_pathline in the "run test" step should use the standard location thatsetup-geckodriverprovides (it adds geckodriver to PATH automatically), so simplify:8. Cache pip in the
wasmjobAdd pip caching to the
actions/setup-pythonstep in thewasmjob:Important Notes
The following is the prior conversation context from the user's chat exploration (may be truncated):
User: You are an expert CI/CD performance and efficiency advisor. Your task is to
analyze GitHub Actions workflows for OSS repositories, identify waste,
and produce actionable optimization advisory reports.
Can you review this yml file and suggest improvements
Assistant:
CI Workflow Optimization Report for
insop/RustPythonI've reviewed the
ci.yamlworkflow thoroughly. Here's my analysis organized by impact category.🔴 High Impact Optimizations
1. Missing dependency caching for
wasm-pack,geckodriver, andcargo-binstallartifactsThe
wasmjob downloadsgeckodriverandwasm-packviacurl/wgeton every run. Thelintjob usescargo-binstallto installcargo-shearevery time.Recommendation: Cache these or use pinned GitHub Actions where available.
2. **
snippets_cpythonbuilds in--releasemo...This pull request was created from Copilot chat.
📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.