Cache IntelliJ SDK in CI#125
Merged
Merged
Conversation
The sbt-idea-plugin downloads the full IntelliJ SDK (~800MB) on build load, which the default sbt cache doesn't cover, so every CI run re-downloaded it. Cache it via actions/cache keyed on build.sbt, so the entry invalidates when intellijBuild bumps but is reused otherwise.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds GitHub Actions caching for the IntelliJ SDK directory downloaded by sbt-idea-plugin, reducing repeated ~800MB downloads across CI runs by restoring the SDK cache before formatting/build steps.
Changes:
- Add an
actions/cache@v4step viagithubWorkflowBuildPreambleto cache~/.intellij-hoconPluginIC. - Regenerate
.github/workflows/ci.ymlto include the new cache step in the build job. - Minor formatting change to the
intellijPluginssetting.
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| build.sbt | Adds workflow preamble step to cache the IntelliJ SDK directory before running sbt tasks. |
| .github/workflows/ci.yml | Regenerated workflow including the IntelliJ SDK cache step. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
halotukozak
approved these changes
May 28, 2026
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
The
sbt-idea-plugindownloads the full IntelliJ SDK (~611MB IDE + ~221MB JBR) on build load, into~/.intellij-hoconPluginIC. The defaultcache: sbt(coursier/ivy/sbt-boot) doesn't cover that directory, so every CI run re-downloaded ~800MB.This adds an
actions/cache@v4step (first in the build job, before the scalafmt and build/test steps) so the SDK is restored once and reused.${{ runner.os }}-intellij-sdk-${{ hashFiles('build.sbt') }}—intellijBuildlives inbuild.sbt, so a version bump correctly invalidates the entry.build.sbtchange still restores the same-version SDK fully (the plugin only tops up if needed).autoRemoveOldCachedIntelliJSDK/autoRemoveOldCachedDownloadssettings, which keep the cached dir lean (one SDK version, no leftover archives).Wired via
githubWorkflowBuildPreambleinbuild.sbt(CI is generated by sbt-github-actions);.github/workflows/ci.ymlis regenerated, not hand-edited.Why it's worth it
Version bumps on master are infrequent (~every 1-2 months), so most runs — code PRs, scala-steward dep bumps — hit a warm cache and skip the download. Version-bump PRs miss, which is unavoidable.
Test plan
sbt githubWorkflowGenerate+githubWorkflowCheckpass (workflow matches build config)