Repository navigation
feat: cache the Vite+ toolchain in GitHub Actions - #207
Merged
Merged
Conversation
fengmk2
added this pull request to stack #208
October 19, 2026 02:53
Member
Author
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
fengmk2
force-pushed
the
codex/cache-toolchain
branch
from
October 19, 2026 03:49
33d3e0d to
6bdb362
Compare
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.
Fresh runners download the CLI dependencies and Node.js on each job. Add
cache-toolchain: trueto restore these files before installation.The cache requires exact Vite+ and managed Node.js versions. Moving versions retain normal resolution. The installer recreates configuration and active links after restoration. Invalid caches fall back to installation. Windows restores recreate dependency junctions before validation.
The action has two independent caches:
cache-toolchaincachevp installThe diagram shows fresh runners with the available caches enabled and
run-install: true.flowchart TB subgraph after["After"] direction TB A1[("NEW: toolchain<br/>Restore and validate")] A2["Install toolchain<br/>Hit: reuse files<br/>Miss: download"] A3[("Dependency cache<br/>Restore packages")] A4["vp install<br/>Use cached packages"] A1 --> A2 --> A3 --> A4 end subgraph before["Before"] direction TB B1["Install toolchain<br/>Download files"] B2[("Dependency cache<br/>Restore packages")] B3["vp install<br/>Use cached packages"] B1 --> B2 --> B3 end classDef newCache fill:#dafbe1,stroke:#1a7f37,color:#1f2328 classDef existingCache fill:#ddf4ff,stroke:#0969da,color:#1f2328 class A1 newCache class B2,A3 existingCachevp installuses restored packages and downloads missing packages. Both caches default tofalse.cache-savecontrols uploads for both enabled caches after a successful job. When both caches need uploads, the post action saves them concurrently and waits for both.toolchain-cache-hitreports a validated toolchain restore. Toolchain caching applies only to GitHub Actions.Hosted benchmark: six samples per OS, using action
dc128eeand Node.js22.23.1. The Vite+ preview is65f9bc56f1f2d87e138013c5bcde9e7306d8eeb8.These measurements isolate the toolchain cache:
cache: falseandrun-install: false.Each sample runs all three cases in one hosted job. Each case starts with an empty installation and package caches. Misses upload to GitHub's cache service; hits download from it. The uncached case alternates before or after the miss/hit pair.
These medians include the action's main and post processes. They include cache transfer, extraction, validation, and upload costs. They exclude checkout, separate correctness checks, and artifact uploads.
One entry per platform totals about 244 MiB (0.24 GiB) of compressed storage. These sizes exclude project dependency caches and extracted files on runners. Sizes vary with toolchain versions. Each new cache key stores a complete toolchain archive; cache hits reuse the existing entry.
Different keys and GitHub cache scopes can retain separate entries. Both cache types share the repository's Actions cache storage limit, which defaults to 10 GB. Use
cache-save: falseto restore without uploading new entries.Misses cost more because they upload the cache. Results depend on runner and network conditions; caching remains opt-in. The run artifacts contain individual timings and logs.
All 54 cases check the exact versions, native binding, and formatter. The published-release run also passes cache misses and hits on all three operating systems with
1.3.0.