-
Notifications
You must be signed in to change notification settings - Fork 450
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MAINT: improving build/test time #820
MAINT: improving build/test time #820
Conversation
I'm curious: How does this cache help? We only pull the packages once, don't we? |
Great question, GitHub Actions always spins up brand new VMs for every single workflow run. Without caching, even a tiny change in the same PR causes it to re-download and reinstall all our Python packages from scratch, which can get pretty time-consuming especially if we have tons of dependencies or multiple matrix jobs. If we use a cache keyed to the OS, Python version, and the hash of our This really helps with active PRs where we push updates frequently. Each subsequent commit or push can skip the full reinstall, running much faster and improving our feedback loop. It might not seem huge at first, but when it’s repeated across multiple PRs and pushes, it really adds up. It also benefits new PRs that share the same dependencies, so they start out hitting the cache as well. We had builds that took 21 minutes 👀 nobody has time for that. With caching, we’re already down to 7 minutes |
Do we ever need to clear the cache? |
You generally won’t need to clear the cache manually. GitHub automatically handles cache eviction after 7 days of inactivity (or 10GB), so old or unused caches get cleaned up on their own. Also, whenever we change our dependencies in pyproject.toml, the cache key changes automatically, so any old caches no longer get used. The only time you might need to clear the cache manually is if something gets corrupted or if you want a fresh start for some reason (very rare). In that case, you could just update your cache key (so it doesn’t match the old one) or go to the repository’s Actions settings to delete any existing caches. But under normal circumstances, you don’t have to clear the cache it just works on its own. Here is from GitHub's docs: If you exceed the limit, GitHub will save the new cache but will begin evicting caches until the total size is less than the repository limit. |
Can we add a comment regarding that and maybe a link to the GH cache docs into the workflow definition? |
@romanlutz done |
…com/bashirpartovi/PyRIT into dev/bashirpartovi/faster-build-test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love it, great work!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
Description
Checkout the runs to see the details of the caching