mirror of
https://github.com/garrytan/gstack.git
synced 2026-09-15 17:35:29 +02:00
restore-deps: 'cp -r SRC node_modules' with an existing node_modules NESTS the copy and leaves stale deps active — rm first. register-gstack-skills: 'ln -snf' hard-errors under set -eu when a REAL directory occupies the gstack slot — clear a non-symlink leftover first. CI workspaces are fresh today; a reusable composite must survive dirty reruns. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
25 lines
1.1 KiB
YAML
25 lines
1.1 KiB
YAML
name: Restore deps
|
|
description: >
|
|
Restore the CI image's pre-installed node_modules via recursive copy, or
|
|
fall back to bun install when the lockfile changed. Symlinking breaks bun's
|
|
realpath-based module resolution (realpath escapes the workspace and
|
|
sibling deps stop resolving); hardlink copy fails across overlay-fs layers
|
|
("Invalid cross-device link"). Recursive copy costs ~5s for ~200 packages —
|
|
still far cheaper than a network install. Extracted from five byte-similar
|
|
copies across the eval lanes.
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
- shell: bash
|
|
run: |
|
|
if [ -d /opt/node_modules_cache ] && diff -q /opt/node_modules_cache/.bun.lock bun.lock >/dev/null 2>&1; then
|
|
# rm first: `cp -r SRC node_modules` with an existing node_modules
|
|
# NESTS the copy (node_modules/node_modules_cache) and leaves stale
|
|
# deps active. CI workspaces are fresh today, but a reusable
|
|
# composite must survive a rerun/dirty workspace (codex diff review).
|
|
rm -rf node_modules
|
|
cp -r /opt/node_modules_cache node_modules
|
|
else
|
|
bun install
|
|
fi
|