Skip to content

ci: save caches only on main, restore-only on PRs - #356

Merged
Zygimantass merged 1 commit into
mainfrom
pyramid/f0662b6a-a520-42ad-a081-c75a0c0ad84f
Nov 5, 2026
Merged

Zygimantass merged 1 commit into
mainfrom
pyramid/f0662b6a-a520-42ad-a081-c75a0c0ad84f

Conversation

@Zygimantass

Copy link
Copy Markdown
Member

Rust caches (Swatinem/rust-cache) in the lint and test workflows now save only on main via save-if, so PR and merge-queue runs restore without saving; the decode-tx job's setup-foundry RPC cache (unused, since decode-tx makes no RPC calls) is likewise enabled only on main. PR-run cache saves push the repo over GitHub's 10 GB cache limit (currently 10.1 GB, 37% from PR refs), so LRU eviction drops the caches built on main and most runs end up uncached.

Investigated in https://pyramid.tehq.net/threads/3ece5de5-7dee-40ba-84d1-648994454750

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM. This is a small CI cache config change and it matches what the PR describes.

What was reviewed:

  • All four rust-cache steps (clippy, cargo check, cargo test, decode-tx) now have save-if set to github.ref == 'refs/heads/main'. The workflows run on push to main, pull_request and merge_group, so caches are saved only on main pushes and other runs still restore.
  • The setup-foundry cache toggle turns the Foundry cache off completely on non-main refs. That's fine here because tests/decode-tx.sh has no RPC or fork usage, so there is nothing for that cache to speed up.
Extended reasoning...

The change touches only .github/workflows/lint.yml and .github/workflows/test.yml. It adds a save-if input to the existing SHA-pinned rust-cache steps and a cache input to one setup-foundry step. Job permissions, triggers and action pins are unchanged, and there is no security-sensitive surface. The repo has no CODEOWNERS file, the PR has no other reviewer activity, and the bug hunt finished on dry_streak with no findings.

@Zygimantass
Zygimantass merged commit 3849eb5 into main Nov 5, 2026
11 checks passed
@Zygimantass
Zygimantass deleted the pyramid/f0662b6a-a520-42ad-a081-c75a0c0ad84f branch November 5, 2026 10:51
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.

1 participant