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

Add restore key to _freeze cache key #537

Merged
merged 1 commit into from
Oct 14, 2024
Merged

Add restore key to _freeze cache key #537

merged 1 commit into from
Oct 14, 2024

Conversation

penelopeysm
Copy link
Member

@penelopeysm penelopeysm commented Oct 11, 2024

This PR makes a tiny change to both preview and publish workflows:

- name: Restore cached _freeze folder
id: cache-restore
uses: actions/cache/restore@v4
with:
path: |
./_freeze/
key: |
${{ runner.os }}-${{ hashFiles('**/Manifest.toml') }}-${{ hashFiles('**/index.qmd') }}
restore-keys: |
${{ runner.os }}-${{ hashFiles('**/Manifest.toml') }}

The main cache key itself will now be determined by both the Manifest as well as the contents of the notebooks (**/index.qmd). However, if the contents of the notebooks have changed, it will use the restore key to load the latest version of _freeze that was run with the same Manifest.

The aim is to let each CI run access the most recently cached _freeze folder, to avoid re-rendering the same docs page on successive CI runs.

Closes #536

Copy link
Contributor

Preview the changes: https://turinglang.org/docs/pr-previews/537
Please avoid using the search feature and navigation bar in PR previews!

@penelopeysm penelopeysm requested a review from mhauru October 14, 2024 16:02
Copy link
Member

@mhauru mhauru left a comment

Choose a reason for hiding this comment

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

The code makes sense to me, but I don't understand the GA caching business well. Is there a way for us to see that it's working as intended?

@penelopeysm
Copy link
Member Author

Sadly, not until it's merged 🙃

@penelopeysm penelopeysm merged commit 8238df4 into master Oct 14, 2024
4 checks passed
@penelopeysm penelopeysm deleted the py/cache-better branch October 14, 2024 17:20
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.

Cache _freeze folder more intelligently
2 participants