Skip to content

ci: Migrate to uv and slash CI time by 55%#664

Merged
hiyouga merged 11 commits intohiyouga:mainfrom
abstract-333:ci/optimize-test-workflow
Mar 10, 2026
Merged

ci: Migrate to uv and slash CI time by 55%#664
hiyouga merged 11 commits intohiyouga:mainfrom
abstract-333:ci/optimize-test-workflow

Conversation

@abstract-333
Copy link
Copy Markdown
Contributor

📝 Summary

This PR optimizes the CI test workflow by migrating dependency installation from pip to uv and implementing a more efficient caching strategy.

In previous versions, dependency caching with pip was not working properly. As a result, all dependencies were installed from scratch on every CI run, which significantly increased the workflow runtime.


🛠️ Changes

🛡 Zero Breaking Changes

  • No environment changesrequirements.txt and setup.py remain untouched.
  • The optimization only affects the CI workflow configuration.

Core Action Upgrades

  • actions/checkout@v4v6
  • actions/setup-python@v5v6

Dependency Management

  • Added astral-sh/setup-uv@v7 (pinned to 0.10.7)

CI Cache Optimization

  • Enabled dependency caching for CI test requirements.
  • Removed torch and torchvision from .github/requirements-test.txt to:
    • avoid duplicate downloads
    • prevent large cache artifacts
    • keep cache restores fast and lightweight.

⚡ Performance Impact

Phase Before (pip) After (uv) Improvement
Total Runtime 1m 30s 40s -55% 🚀
Cache Restore ~25s ~3s -88%
Cache Size ~400 MB 14 MB -96%

🧪 Verification

  • Style check (make style)
  • Quality check (make quality)
  • License check (make license)
  • Pytest suite completed successfully

Workflow execution time: ~40 seconds
🔗 GitHub Actions run:
https://github.com/abstract-333/EasyR1/actions/runs/22881238873

- Bump actions/checkout from v4 to v6
- Bump actions/setup-python from v5 to v6
- Ensure compatibility with latest runner environments
- Upgrade actions/checkout and actions/setup-python to v6
- Implement astral-sh/setup-uv@v7 for faster dependency installs
- Pin uv version to 0.10.7
- Enable uv caching targeting requirements-test.txt
- Remove torch and torchvision from requirements-test.txt
- Install torch/torchvision via CPU index separately to avoid cache bloat
- Restrict uv caching to lightweight libraries for faster restore
- Upgrade actions to v6 and pin uv to 0.10.7
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the efficiency of the continuous integration pipeline. By transitioning from pip to uv for dependency management and implementing a robust caching mechanism, the CI workflow's total runtime has been drastically reduced, leading to faster feedback cycles and more streamlined development.

Highlights

  • CI Performance Improvement: Migrated dependency installation from pip to uv in the CI workflow, resulting in a 55% reduction in total runtime.
  • Dependency Caching Optimization: Implemented an efficient caching strategy for CI test requirements, reducing cache restore time by 88% and cache size by 96%.
  • Core Action Upgrades: Updated GitHub Actions for checkout and setup-python to their latest major versions (v6).
  • Test Requirements Refinement: Removed torch and torchvision from .github/requirements-test.txt to prevent duplicate downloads and optimize cache artifacts.
Changelog
  • .github/requirements-test.txt
    • Removed torch and torchvision from the test requirements.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/tests.yml
Activity
  • The author has verified the changes by successfully running style, quality, license, and pytest checks.
  • A GitHub Actions run confirmed the workflow execution time of approximately 40 seconds.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request migrates the CI from pip to uv, which significantly improves performance by optimizing dependency installation and caching. The changes involve updating GitHub Actions and removing torch and torchvision from the test requirements. My review focuses on further improving dependency management in .github/requirements-test.txt for better maintainability. I've suggested removing a redundant dependency, which also resolves a minor formatting issue.

Note: Security Review has been skipped due to the limited scope of the PR.

Comment thread .github/requirements-test.txt Outdated
@hiyouga hiyouga merged commit f8708f0 into hiyouga:main Mar 10, 2026
1 check passed
@abstract-333 abstract-333 deleted the ci/optimize-test-workflow branch March 16, 2026 12:00
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.

2 participants