Merge pull request 'ci: node_modules cache (package-lock.json hash-based)' (#30) from feature/fix-ci-pip-3.8-url into main
This commit is contained in:
+22
-1
@@ -64,7 +64,28 @@ jobs:
|
||||
echo "$VENV/bin" >> $GITHUB_PATH
|
||||
|
||||
- name: Install Node Dependencies
|
||||
run: npm install --quiet
|
||||
run: |
|
||||
# package-lock.json 해시로 캐시 유효성 판단
|
||||
CACHE_BASE=/volume1/gitea/node_cache
|
||||
LOCK_HASH=$(md5sum package-lock.json 2>/dev/null | cut -d' ' -f1 || echo "no-lock")
|
||||
CACHE_DIR="$CACHE_BASE/$LOCK_HASH"
|
||||
|
||||
if [ -d "$CACHE_DIR/node_modules" ]; then
|
||||
echo "=== node_modules 캐시 히트: $LOCK_HASH ==="
|
||||
# 캐시에서 심볼릭 링크로 연결 (복사 대신 즉시)
|
||||
rm -rf node_modules
|
||||
ln -s "$CACHE_DIR/node_modules" node_modules
|
||||
else
|
||||
echo "=== npm install (최초 or lock 변경) ==="
|
||||
npm install --quiet
|
||||
# 캐시 저장
|
||||
mkdir -p "$CACHE_DIR"
|
||||
cp -r node_modules "$CACHE_DIR/node_modules"
|
||||
echo "캐시 저장 완료: $CACHE_DIR"
|
||||
# 오래된 캐시 정리 (최근 3개만 유지)
|
||||
ls -dt "$CACHE_BASE"/*/ 2>/dev/null | tail -n +4 | xargs rm -rf 2>/dev/null || true
|
||||
fi
|
||||
node --version && npm --version
|
||||
|
||||
- name: Validate Specs
|
||||
run: python3 tools/validate_specs.py
|
||||
|
||||
@@ -161,6 +161,7 @@ def main() -> int:
|
||||
"rows": rows,
|
||||
}
|
||||
|
||||
out_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
out_path.write_text(json.dumps(result, ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
|
||||
print(
|
||||
f"[YAML_TO_CODE_COVERAGE_V1] total={len(all_spec_ids)} "
|
||||
|
||||
Reference in New Issue
Block a user