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

Enable pip caching for GitHub Actions #14

Merged
merged 1 commit into from
Aug 14, 2023
Merged

Conversation

mgorny
Copy link

@mgorny mgorny commented Aug 13, 2023

Enable pip caching in order to avoid repeatedly rebuilding all the PyPy wheels for source packages. This is inspired by discussion in psf/requests#6496 and it may help with the PyPy CI failures.

@mgorny mgorny force-pushed the pip-cache branch 3 times, most recently from 24ec99c to dd387a1 Compare August 13, 2023 03:08
@mgorny
Copy link
Author

mgorny commented Aug 13, 2023

Ok, I think it works!

Notes:

  1. It writes a new cache entry for every commit but I think it's fine, GH will simply have more purging to do.
  2. It only works if action doesn't exceed timeout but if that happens at least once, the subsequent runs should be fast enough.
  3. It's using deprecated method of setting build output — the new method doesn't work on Windows for some reason.

Enable pip caching in order to avoid repeatedly rebuilding all
the PyPy wheels for source packages.  This is inspired by discussion
in psf/requests#6496 and it may help with
the PyPy CI failures.
@mgorny
Copy link
Author

mgorny commented Aug 13, 2023

Switched to the new output variable method — it turned out that the example was wrong and shell: bash needs to be used. Filed actions/cache#1220 for that.

@kevin1024 kevin1024 merged commit 25c7bfa into psf:main Aug 14, 2023
27 checks passed
@mgorny mgorny deleted the pip-cache branch August 14, 2023 04:15
@mgorny
Copy link
Author

mgorny commented Aug 14, 2023

Thanks! By the way, you may reconsider the 10m timeout too, as that was the direct cause of PyPy failures before we sped it up.

id: pip-cache
shell: bash
run: |
echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT

Choose a reason for hiding this comment

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

echo" dir=$50000
(pip cache dir)" >s $GITHUB_oUTPUT

id: pip-cache
shell: bash
run: |
echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT

Choose a reason for hiding this comment

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

echo" dir=$50000
(pip cache dir)" >s $GITHUB_oUTPUT

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