Skip to content

Optimize CI by caching uv virtual environment and speed the testing#610

Closed
archit7-beep wants to merge 1 commit intomllam:mainfrom
archit7-beep:ci-cd_fix
Closed

Optimize CI by caching uv virtual environment and speed the testing#610
archit7-beep wants to merge 1 commit intomllam:mainfrom
archit7-beep:ci-cd_fix

Conversation

@archit7-beep
Copy link
Copy Markdown
Contributor

Describe your changes

This PR improves the robustness of the CI caching mechanism for uv-based virtual environments. It ensures that the cached .venv is safely reused on cache hits and avoids potential failures caused by stale or partially restored environments.

The current workflow assumes that a restored .venv is always valid. However, in rare cases (e.g., cache corruption or incomplete restoration), this can lead to runtime failures.

This change introduces a safer handling of cached environments by ensuring that the workflow behaves correctly across both cache hits and misses, without altering the existing dependency installation logic or CI behavior.

No new dependencies are introduced. The changes rely only on existing tools (uv, pip, and GitHub Actions caching).

Issue Link

Closes (#605 )

Type of change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📖 Documentation (Addition or improvements to documentation)

Checklist before requesting a review

  • My branch is up-to-date with the target branch - if not update your fork with the changes from the target branch (use pull with --rebase option if possible).
  • I have performed a self-review of my code
  • For any new/modified functions/classes I have added docstrings that clearly describe its purpose, expected inputs and returned values
  • I have placed in-line comments to clarify the intent of any hard-to-understand passages of my code
  • [] I have updated the README to cover introduced code changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have given the PR a name that clearly describes the change, written in imperative form (context).
  • I have requested a reviewer and an assignee (assignee is responsible for merging). This applies only if you have write access to the repo, otherwise feel free to tag a maintainer to add a reviewer and assignee.

Checklist for reviewers

Each PR comes with its own improvements and flaws. The reviewer should check the following:

  • the code is readable
  • the code is well tested
  • the code is documented (including return types and parameters)
  • the code is easy to maintain

Author checklist after completed review

  • I have added a line to the CHANGELOG describing this change, in a section
    reflecting type of change (add section where missing):
    • added: when you have added new functionality
    • changed: when default behaviour of the code has been changed
    • fixes: when your contribution fixes a bug
    • maintenance: when your contribution is relates to repo maintenance, e.g. CI/CD or documentation

Checklist for assignee

  • PR is up to date with the base branch
  • the tests pass
  • (if the PR is not just maintenance/bugfix) the PR is assigned to the next milestone. If it is not, propose it for a future milestone.
  • author has added an entry to the changelog (and designated the change as added, changed, fixed or maintenance)
  • Once the PR is ready to be merged, squash commits and merge the PR.

@kshirajahere
Copy link
Copy Markdown
Contributor

kshirajahere commented Apr 17, 2026

Isnt it being solved in #606? and assigned to @Sharkyii

@sadamov
Copy link
Copy Markdown
Collaborator

sadamov commented Apr 17, 2026

Hi, I don't think we need a second PR here, instead you could add your review directly to #606

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants