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

Build: re-build the cache for every commit #433

Merged
merged 7 commits into from
Sep 26, 2022

Conversation

alexklibisz
Copy link
Owner

@alexklibisz alexklibisz commented Sep 26, 2022

Related Issue

Changes

  • Re-build the cache for every commit by keying on the commit name instead of the branch name. The previous strategy used the branch name in the key. But, if an entry already exists in the cache, it won't be overridden. Github will just continue pulling the older entry. That means it keeps pulling the 7-day old master-branch entry when running for a push to master, and keeps pulling the first entry from a given branch when running for a PR. To solve this, we can key on the commit sha, with a fallback to the previous commit sha. This will create more churn in the cache, but it doesn't really matter since Github cleans all of that up.

Testing and Validation

How was it validated?

@alexklibisz alexklibisz changed the title Build: re-use cache correctly Build: re-build the cache for every commit Sep 26, 2022
@alexklibisz alexklibisz marked this pull request as ready for review September 26, 2022 12:05
@alexklibisz alexklibisz merged commit 93550ce into master Sep 26, 2022
@alexklibisz alexklibisz deleted the test-gh-actions-cache-2 branch September 26, 2022 12:05
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.

1 participant