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

Replace github cache action with restore and save #24

Merged
merged 1 commit into from
Oct 4, 2023

Conversation

LucilleH
Copy link
Contributor

@LucilleH LucilleH commented Oct 4, 2023

What

Instead of letting action/cache do the restoring and saving cache for us, we choose when to restore and when to save cache.

In this case, we will be saving cache immediately after the devbox package installation, instead of waiting for the action post run. This way, the tar sudo permission stays intact until the cache is saved.

More specifically, action/cache/save runs before the last step of restoring tar to its original permission (as oppose to after)

@LucilleH LucilleH force-pushed the lucille--save-action branch 2 times, most recently from 5c711d4 to 35fb858 Compare October 4, 2023 18:41
@LucilleH LucilleH force-pushed the lucille--save-action branch from 35fb858 to 7dd68e9 Compare October 4, 2023 18:45
@LucilleH LucilleH requested review from gcurtis and mikeland73 October 4, 2023 18:58
Copy link
Contributor

@mikeland73 mikeland73 left a comment

Choose a reason for hiding this comment

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

Is there no way around this? Two downsides:

  • More complexity from handling restore/save ourselves
  • We save the cache even if the test fails which could potentially leave the cache in a bad state.

with:
path: /usr/local/bin/devbox
key: ${{ runner.os }}-devbox-${{ env.latest_version }}
key: ${{ runner.os }}-devbox-cli-${{ env.latest_version }}
Copy link
Contributor

Choose a reason for hiding this comment

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

I vote for not caching the cli. Do we really save anything? Downloading from s3 is basically a cache already.

Removing it makes the action simpler.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the devbox launcher is fetching the actual binary from Github. When actions are running in parallel, we would hit the github rate limit.

@LucilleH
Copy link
Contributor Author

LucilleH commented Oct 4, 2023

  • We save the cache even if the test fails which could potentially leave the cache in a bad state.

Do you mean even if devbox install fails? I think the cache step won't run if the previous step devbox install fails

@LucilleH LucilleH added this pull request to the merge queue Oct 4, 2023
Merged via the queue into main with commit e523b1c Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants