mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-08 00:50:05 +00:00
refactor: improve .cache directory caching strategy
Changes: - Move cache restore to setup-frontend action BEFORE build operations - Remove duplicate cache step from setup-playwright action - Use cache/restore instead of cache to avoid auto-save behavior - Rename cache key from 'playwright-setup-cache' to 'tool-cache' for clarity - Include source file hashes in cache key for proper invalidation Benefits: - Cache is now restored before tools run, allowing them to use cached data - Eliminates duplicate caching of ./.cache directory - Cache properly invalidates when source files or configs change - Follows GitHub Actions best practice of restore before, save after pattern - The workspace cache in tests-ci.yaml handles saving the complete state Note: The .cache directory contains outputs from ESLint, Prettier, Stylelint, Knip, and TypeScript incremental builds. These should be restored before any build/lint operations run.
This commit is contained in:
12
.github/actions/setup-frontend/action.yml
vendored
12
.github/actions/setup-frontend/action.yml
vendored
@@ -23,6 +23,18 @@ runs:
|
||||
cache: 'pnpm'
|
||||
cache-dependency-path: './pnpm-lock.yaml'
|
||||
|
||||
# Restore tool caches before running any build/lint operations
|
||||
- name: Restore tool output cache
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: |
|
||||
./.cache
|
||||
./tsconfig.tsbuildinfo
|
||||
key: tool-cache-${{ runner.os }}-${{ hashFiles('./pnpm-lock.yaml') }}-${{ hashFiles('./src/**/*.{ts,vue,js,mts}', './*.config.*') }}
|
||||
restore-keys: |
|
||||
tool-cache-${{ runner.os }}-${{ hashFiles('./pnpm-lock.yaml') }}-
|
||||
tool-cache-${{ runner.os }}-
|
||||
|
||||
- name: Install dependencies
|
||||
shell: bash
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
12
.github/actions/setup-playwright/action.yml
vendored
12
.github/actions/setup-playwright/action.yml
vendored
@@ -26,15 +26,3 @@ runs:
|
||||
if: steps.cache-playwright-browsers.outputs.cache-hit == 'true'
|
||||
shell: bash
|
||||
run: pnpm exec playwright install-deps
|
||||
|
||||
- name: Cache tool outputs
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
./.cache
|
||||
./tsconfig.tsbuildinfo
|
||||
key: playwright-setup-cache-${{ runner.os }}-${{ hashFiles('./pnpm-lock.yaml') }}-${{ hashFiles('./src/**/*.{ts,vue,js}', './*.config.*') }}
|
||||
restore-keys: |
|
||||
playwright-setup-cache-${{ runner.os }}-${{ hashFiles('./pnpm-lock.yaml') }}-
|
||||
playwright-setup-cache-${{ runner.os }}-
|
||||
playwright-tools-cache-${{ runner.os }}-
|
||||
|
||||
Reference in New Issue
Block a user