Skip re-installing an already-installed Vite+ version: setup-vp and install.sh re-download on every job (~3s each)
@fengmk2 ya está trabajando en esto.
Desde el 10/9/2026.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
Summary
setup-vp re-runs the Vite+ installer on every job, and the installer has no path that notices the requested version is already installed. On a runner whose home directory persists across jobs (Blacksmith sticky disks, most self-hosted runners), every job pays the same ~3s to download and re-install a vp that is already there. The Node half is already idempotent: vp env use on a present runtime returns in a few milliseconds. Only the installer is not.
Measurement
Repository: a pnpm monorepo, setup-vp@v1.18.0 (the install path is unchanged on main at 0499fae), Vite+ 0.3.0 resolved from package.json, Node 22.23.1 resolved from package.json, cache: false, run-install: false. Runner: blacksmith-4vcpu-ubuntu-2404. vp env keeps its own runtimes under $VP_HOME/js_runtime, so the pinned 22.23.1 is a download on every fresh runner whatever Node the image ships.
One job, timestamps from the log (2026-09-10):
02:33:12.740 curl -fsSL ... /v0.3.0/packages/cli/install.sh -o "$installer_file"; source "$installer_file"
02:33:12.767 Setting up VITE+...
02:33:15.639 ✔ VITE+ successfully installed! <- 2.9s
02:33:15.644 Setting up Node.js 22.23.1 via vp env use...
02:33:15.647 Installing Node.js v22.23.1...
02:33:16.260 Using Node.js v22.23.1 (resolved from 22.23.1) <- 0.6s
##[end-action id=__self.setup-vp;... duration_ms=3613]
Across our jobs the step runs 3.6s to 6.1s: 2.8s to 2.9s in the installer, 0.6s to 1.1s for the Node download, the rest in vp env use and version reporting. Our PR workflow alone starts about 240 runs a day, each with up to six jobs that run this step; even discounting runs cancelled by a newer push, that is on the order of a thousand installs of the same version a day, roughly an hour of runner time spent re-installing a binary the runner already has.
For comparison, once the version directory exists, vp env use 22.23.1 on a present runtime takes about 6 ms, and a pnpm store on a persistent disk turns our workspace install into a link-only 4s. The installer is now the largest fixed cost in the step.
What happens today, from the source
setup-vp (src/install-viteplus.ts, installVitePlus) fetches install.sh for the resolved tag and sources it, unconditionally; there is no check of an existing vp at the target directory and no use of @actions/tool-cache. The only vp --version call in src/index.ts runs after the install, to report the version.
install.sh (packages/cli/install.sh on main at 31b0922a), in main():
get_version_from_metadatafetches the registry metadata forVP_VERSIONand setsRESOLVED_VERSION(network).download_and_extractfetches@voidzero-dev/vite-plus-cli-<platform>-<version>.tgzinto a temp dir (network) and copies the binary into$INSTALL_DIR/$VP_VERSION/bin.- It rewrites
$INSTALL_DIR/$VP_VERSION/package.json(thevp-globalwrapper pinned topnpm@10.33.0) and runsvp installthere to install thevite-plusJS package and its transitive dependencies (network). - It repoints
$INSTALL_DIR/currentand sets up shims.
None of these steps compares the resolved version against what is already in $INSTALL_DIR. detect_previous_install_dir / is_vite_plus_install_dir exist, but they detect an older layout to migrate, not a current same-version install to keep. So a persisted $VP_HOME (we can mount ~/.local/share/vite-plus as a sticky disk) does not save anything: the job still downloads the tarball, re-copies the binary and re-runs the wrapper install on top of an identical tree.
Ask
Either half would do; both would be ideal.
- Installer: after
RESOLVED_VERSIONis known, if$INSTALL_DIR/$RESOLVED_VERSION/bin/vp --versionreports that version and the wrapper install is complete (thecurrentsymlink andnode_modules/vite-pluspresent), skip steps 2 and 3 and go straight tocurrent/shim/Node setup. That makes a persisted$VP_HOMEfree for GitHub, the GitLab template, and any other CI that keeps a home directory, and it also makes re-running the installer locally a no-op. - setup-vp: before running the installer, look for
vpat the target bin directory and skip the installer when its--versionmatches the resolved version; and, for GitHub-hosted runners without a persistent home, cache the installed version directory through@actions/tool-cacheso a warm runner skips the network entirely.
Happy to try a prerelease on our runners and report timings.
- Lenguaje dominante
- TypeScript
- Estrellas
- 110
- Forks
- 22
- Merge medio
- 1 d 5 h
- PR fusionados (30 d)
- 31
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de voidzero-dev/setup-vp
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
voidzero-dev/setup-vp#164 · 1 comentario ·
-
voidzero-dev/setup-vp#161 · 1 asignado ·
-
enhancement
voidzero-dev/setup-vp#155 · 5 comentarios · 1 asignado ·
-
Action is not verified by GitHub Abierto
voidzero-dev/setup-vp#81 · 5 comentarios · 3 reacciones · 1 asignado ·
-
enhancement
voidzero-dev/setup-vp#73 · 1 reacción · 1 asignado ·
Todos los issues de voidzero-dev/setup-vp
Issues similares
-
Browser Waiting for: Product Owner
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
getsentry/sentry-javascript#24577 · 1 comentario ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
agilepathway/label-checker#640 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
copse-dev/agent-pane#2953 ·
-
[aw] Upgrade available Abiertoagentic-workflows
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
githubnext/rig#534 ·
-
automation missing-model model-sync provider:pioneer
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
anomalyco/models.dev#7701 ·