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

Investigate bypassing the CI cache's branch scoping #5

Open
PathogenDavid opened this issue Jul 29, 2021 · 0 comments
Open

Investigate bypassing the CI cache's branch scoping #5

PathogenDavid opened this issue Jul 29, 2021 · 0 comments

Comments

@PathogenDavid
Copy link
Member

PathogenDavid commented Jul 29, 2021

The GitHub Actions cache is scoped to the specific branch which triggered the CI run, except for the main branch which is shared with all child branches. From the documentation:

The cache is scoped to the key and branch. The default branch cache is available to other branches.

There's a few issues covering this: actions/cache#79 actions/cache#183

Unfortunately this is done for security reasons so it's probably not super likely to change soon. Basically it ensures a rogue PR can't poison the cache and negatively affect other branches, which is pretty sensible.

What I do wish they did is make it so feature branches and maybe/optionally PRs from authorized developers weren't affected by this restriction.

I do not see anything in the action its self or the GHA toolkit that enforces this, I bet it's hiding in this URL which probably means we can't manipulate it: https://github.com/actions/toolkit/blob/f0b00fd201c7ddf14e1572a10d5fb4577c4bd6a2/packages/cache/src/internal/cacheHttpClient.ts#L36

Might be worth implementing our own caching instead.

Looking at a recent run, it looks like our cached artifacts total ~208 MB after compression:

Artifact Platform Size
LLVM build outputs Windows 23 MB
LLVM build outputs Linux 31 MB
LLVM sccache Windows 94 MB
LLVM sccache Linux 60 MB

*Oops, that's not right. Looks like it's only getting the symlink. Assumed it's about the same as Windows when compressed for that 200 MB figure. Fixed

At the very least we should be saving the build outputs so we don't bother rebuilding LLVM when it doesn't change.

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

No branches or pull requests

1 participant