Skip to content

Cache gems and Solargraph annotations across CI runs - #1357

Draft
apiology wants to merge 9 commits into
castwide:masterfrom
apiology:cache_in_draft_prs
Draft

apiology wants to merge 9 commits into
castwide:masterfrom
apiology:cache_in_draft_prs

Conversation

@apiology

Copy link
Copy Markdown
Contributor

This PR was written by Claude Code on behalf of @apiology.

Problem: Every CI job rebuilds Solargraph's gem annotation cache and reinstalls the bundle from scratch, because neither is carried between runs.

linting.yml is the one job that tries, and it cannot work: actions/cache/restore only reads, and nothing writes that key.

# .github/workflows/linting.yml
- name: Restore cache of gem annotations
  uses: actions/cache/restore@v4   # restore-only, so the key is never saved
  with:
    key: 2025-06-26-09-${{ runner.os }}-dot-cache-${{ hashFiles('Gemfile.lock') }}

Solution: Promote that step to actions/cache@v4, whose post-job hook saves the key; add it to the rspec, typecheck and four plugin jobs; and turn on setup-ruby's bundler-cache under the cache-version linting.yml already carried.

Warm run vs master at the merged commit:

job master warm
Solargraph / strong 327s 128s
rails 844s 351s
rspec 806s 450s
regression 921s 633s
rspec matrix, mean of 17 632s 366s

One run each, not a benchmark. Both caches key on Gemfile.lock, so a dependency change starts cold, and that run is slower than master since it also pays the save.

# Conflicts:
#	.github/workflows/plugins.yml
#	.github/workflows/rspec.yml
#	.github/workflows/typecheck.yml
The setup-ruby bundler cache is busted by cache-version, so two
different values across jobs give those jobs separate caches for no
reason. linting.yml already carried 2026-01-11 from master while the
ten cache-version entries added here said 2025-06-06.

Use master's value everywhere.
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

Successfully merging this pull request may close these issues.

1 participant