Skip to content
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

chore: replace custom cache step with config #11572

Merged
merged 2 commits into from Jun 15, 2022

Conversation

miketheman
Copy link
Member

The actions/setup-python@v2 and higher included a built-in cache
restore and post-run save step, meaning we can now retire our custom
steps for the configuration we want and gain some speed here.

Refs: actions/setup-python#266
Refs: https://github.com/actions/setup-python#caching-packages-dependencies

The actions/setup/node@v2 introduced support for configuring cache for
npm.
Since we use defaults, no changes are necessary other than setting the
installer type.

Refs: actions/setup-node#272

Signed-off-by: Mike Fiedler miketheman@gmail.com

@miketheman
Copy link
Member Author

This does not impair existing caching behaviors, as the main addition is the post-action cache save, which due to the structure of the CI jobs, will collide on save - first one wins. Example: https://github.com/pypa/warehouse/runs/6850862495?check_suite_focus=true#step:16:3

I'm thinking about a general refactor of the steps here - and introducing a step-based workflow that runs the Dependencies job first - which should set up the cache for all other steps, and thus speed everything up a bit - saving ~1.5 minutes on every python-based step.
Should I attempt that in this scope as well, or save for another refactor?

@miketheman
Copy link
Member Author

Should I attempt that in this scope as well, or save for another refactor?

Upon further testing, looks like the downloads are cached, which is fine. Both node_modules and the python environments are not cached/restored between each step, so there won't be much savings anyhow - we can live with the current change of cache/restore of the download dependencies and take a little bit of time savings.

@di
Copy link
Member

di commented Jun 15, 2022

@miketheman I'm having a hard time determining if you're ready for this PR to be merged?

@miketheman
Copy link
Member Author

@di yes, this is ready for merge. I'll keep an eye on vigor the next few PRs and merges, and continue to think about how cache can improve.

The `actions/setup-python@v2` and higher included a built-in cache
restore and post-run save step, meaning we can now retire our custom
steps for the configuration we want and gain some speed here.

Refs: actions/setup-python#266
Refs: https://github.com/actions/setup-python#caching-packages-dependencies

Signed-off-by: Mike Fiedler <miketheman@gmail.com>
The `actions/setup/node@v2` introduced support for configuring cache for
npm.
Since we use defaults, no changes are necessary other than setting the
installer type.

Refs: actions/setup-node#272

Signed-off-by: Mike Fiedler <miketheman@gmail.com>
@di di merged commit ac62bb7 into pypi:main Jun 15, 2022
@miketheman miketheman deleted the miketheman/better-gha-cache branch June 15, 2022 23:48
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.

None yet

2 participants