Add checkout-with-cache composite action#35
Draft
benstpierre wants to merge 1 commit into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This is a small proposal based on a helper action we have been using at Galatea to speed up large repository checkouts on RunsOn runners. It adds a composite action at
checkout-with-cache/that restores a cached repository.gitsnapshot from RunsOn EFS before runningactions/checkout, then updates and rotates the cache afterward.I am not 100% sure whether this repository is the right final home for it, so I opened this as a draft. If you would rather have this live in a tiny dedicated repo like
runs-on/checkout-with-cache, that may actually be better for runtime performance because checkout acceleration should not require downloading a larger action repo first. Happy to reshape this however you prefer.Why
For large repos using
fetch-depth: 0, checkout can dominate job startup time. In one Galatea repo (galateatech/waste-coordinator), we saw roughly:actions/checkout@v6withfetch-depth: 0: about 34sThis felt like something worth proposing upstream because the useful bit is really the RunsOn EFS/cache behavior, not anything Galatea-specific.
Usage
The action wraps
actions/checkout@v6, defaults to/mnt/efs/${GITHUB_REPOSITORY}/.git, stores files asrepository-<sha>-<timestamp>.tar, and optionally encrypts them withopenssl enc -aes-256-cbc -pbkdf2.Safety / behavior
persist-credentialsdefaults tofalseforactions/checkout.gitValidation
bash -n checkout-with-cache/*.shshellcheck checkout-with-cache/*.shThanks for taking a look. We found this really helpful internally, and I figured it might be useful to other RunsOn users too if you like the shape.