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

fix: fix Github workflow caches to restore successfully more often #3154

Merged
merged 6 commits into from
Oct 2, 2023

Conversation

ansgarm
Copy link
Member

@ansgarm ansgarm commented Sep 29, 2023

This PR

  • Stops using random temporary directories for caches, as these make cache hits impossible (the cached paths are part of the "cache version" which needs to match in order for caches to be restored)
  • Starts using the same cache directories for caches of the same type (e.g. /usr/local/share/.cache/go for the Go cache). This allows us to get cache hits between different jobs as a fallback
  • Starts using distinct cache directories for all caches of the same type (types being terraform, go, yarn and providerSchema).
  • Re-names the cache keys to allow cache hits using a hierarchical restore-keys definition
  • Defines restore-keys for caches of the same type. This allows us to restore e.g. a yarn cache from a different job if there's no cache already for the current job (while the cache might not match 100%, it will still improve the results)
  • fixes the specified Terraform version for provider integration tests (used to access a matrix variable that does not exist for these tests; probably a copy&paste error)
  • removes the usage of YARN_CACHE_FOLDER which is not necessary, since our cache is in the yarn cache dir already
  • removes GOCACHE for jobs that don't require it

Copy link
Contributor

@mutahhir mutahhir left a comment

Choose a reason for hiding this comment

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

Approving, with comments regarding improvements

.github/workflows/build.yml Show resolved Hide resolved
.github/workflows/build.yml Show resolved Hide resolved
.github/workflows/examples.yml Show resolved Hide resolved
.github/workflows/examples.yml Outdated Show resolved Hide resolved
.github/workflows/unit.yml Outdated Show resolved Hide resolved
Copy link
Contributor

github-actions bot commented Nov 2, 2023

I'm going to lock this pull request because it has been closed for 30 days. This helps our maintainers find and focus on the active issues. If you've found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants