Update GitHub Actions caching strategy by zwass · Pull Request #8866 · osquery/osquery · GitHub
Skip to content

Update GitHub Actions caching strategy#8866

Open
zwass wants to merge 7 commits into
osquery:masterfrom
zwass:submodule-cache
Open

Update GitHub Actions caching strategy#8866
zwass wants to merge 7 commits into
osquery:masterfrom
zwass:submodule-cache

Conversation

@zwass

@zwass zwass commented Apr 29, 2026

Copy link
Copy Markdown
Member
  • Git submodule caches need only be different for each platform, not for each OS version and architecture (since they should be source-only).
  • Downloads need only be different for each platform (since they are universal in macOS and Windows only has x64).

Caches need only be different for each platform, not for each OS
version and architecture (since they should be source-only).
@zwass zwass added CI/CD Anything about the Continuous Integration or Continuous Deployment tool used by the repository github_actions Pull requests that update GitHub Actions code labels Apr 29, 2026
@zwass zwass changed the title Update submodule caching strategy Update GitHub Actions caching strategy Apr 29, 2026
@zwass zwass marked this pull request as ready for review April 30, 2026 20:23
@zwass zwass requested a review from a team as a code owner April 30, 2026 20:23
@zwass zwass marked this pull request as draft April 30, 2026 20:23
@zwass zwass marked this pull request as ready for review May 4, 2026 05:56
Copilot AI review requested due to automatic review settings June 24, 2026 15:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates the GitHub Actions caching strategy in hosted_runners.yml to reduce cache fragmentation by keying git submodule caches by platform + submodule state (hash) and keying downloads caches by platform, while restricting cache writes to the default branch.

Changes:

  • Removed the SUBMODULE_CACHE_VERSION env and replaced submodule cache keys with runner.os + a computed SHA-256 hash of git submodule status --recursive.
  • Split cache usage into explicit restore vs. save steps, and gated cache saves to the repository default branch.
  • Simplified downloads cache keys/restore keys to be platform-scoped (via runner.os).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 687 to 689

- name: Save cache (git submodules)
if: github.ref_name == github.event.repository.default_branch
uses: actions/cache@v4

- name: Save cache (git submodules)
if: github.ref_name == github.event.repository.default_branch
uses: actions/cache@v4

- name: Save cache (git submodules)
if: github.ref_name == github.event.repository.default_branch
uses: actions/cache@v4

- name: Save cache (downloads)
if: github.ref_name == github.event.repository.default_branch
uses: actions/cache@v4

- name: Save cache (git submodules)
if: github.ref_name == github.event.repository.default_branch
uses: actions/cache@v4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI/CD Anything about the Continuous Integration or Continuous Deployment tool used by the repository github_actions Pull requests that update GitHub Actions code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants