Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@erik-krogh
Copy link

Description

Add support for not saving the cache.

Fixes #350
Fixes #334
Fixes #92

Similar to both #489 and #964, but here it's implemented as an input to the workflow instead of an environment variable.

Motivation and Context

I needed the behavior for this PR: github/codeql#11362.

In github/codeql we have some code that gets faster by using a cache.
But that code can take some shortcuts if it doesn't have to save a new cache.
So on PRs we essentially run in a "read-only" mode, where we don't expect any cache to be populated.
And we make sure that the cache is populated on pushes to main.

Our current workaround is to use a key based on the current commit SHA, which no other run will hit.
But that is currently filling up the cache space in the repo: https://github.com/github/codeql/actions/caches

How Has This Been Tested?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (add or update README or docs)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly. (I'll do that if the PR looks OK).
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@erik-krogh erik-krogh marked this pull request as ready for review November 22, 2022 10:11
@erik-krogh erik-krogh requested a review from a team as a code owner November 22, 2022 10:11
@github-actions github-actions bot requested a review from Phantsure November 22, 2022 10:12
@Phantsure Phantsure assigned kotewar and unassigned Phantsure Nov 30, 2022
@Phantsure Phantsure requested review from kotewar and removed request for Phantsure November 30, 2022 09:57
@kotewar
Copy link
Contributor

kotewar commented Nov 30, 2022

Thanks @erik-krogh for your pull request, we are working on some similar asks (restore only, save only) based on the frequency of these asks.

Would you mind if I close this PR as you can expect us to release similar functionalities in the coming days?

@erik-krogh
Copy link
Author

Thanks @erik-krogh for your pull request, we are working on some similar asks (restore only, save only) based on the frequency of these asks.
Would you mind if I close this PR as you can expect us to release similar functionalities in the coming days?

Sounds great 👍

I'll watch releases in this repo, and change my workflows to your implementation when it arrives.

@erik-krogh erik-krogh closed this Nov 30, 2022
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.

Read only cache? Support for Read Only Cache / Configurable Cache Saving Configurable save cache on failure

3 participants