fix: symlink node_modules instead of hardlink (cross-device)

Docker image layers and workspace are on different filesystems,
so cp -al (hardlink) fails. Use ln -s (symlink) instead — zero
copy overhead.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Garry Tan
2026-03-23 06:56:32 -07:00
parent ce31cb1853
commit fe574f1cd8
+2 -2
View File
@@ -95,12 +95,12 @@ jobs:
with:
fetch-depth: 0
# Restore pre-installed node_modules from Docker image (~1s vs ~15s install)
# Restore pre-installed node_modules from Docker image via symlink (~0s vs ~15s install)
# If package.json changed since image was built, fall back to fresh install
- name: Restore deps
run: |
if [ -d /opt/node_modules_cache ] && diff -q /opt/node_modules_cache/.package.json package.json >/dev/null 2>&1; then
cp -al /opt/node_modules_cache node_modules
ln -s /opt/node_modules_cache node_modules
else
bun install
fi