Skip to content

Commit 1364355

Browse files
committed
fix: git action
1 parent 5a71fb6 commit 1364355

1 file changed

Lines changed: 19 additions & 5 deletions

File tree

.github/workflows/electron-build.yml

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,35 @@ jobs:
3333
steps:
3434
- uses: actions/checkout@v4
3535

36-
# npm tarball cache (~300 MB compressed) — speeds up npm ci downloads
36+
# npm tarball cache (~/.npm) — speeds up downloads inside npm ci
3737
- uses: actions/setup-node@v4
3838
with:
3939
node-version: '22'
4040
cache: 'npm'
4141

42+
# Cache node_modules — on hit, skips npm ci entirely (saves ~1:30)
43+
- uses: actions/cache@v4
44+
id: cache-deps
45+
with:
46+
path: node_modules
47+
key: ${{ runner.os }}-node-modules-${{ hashFiles('package-lock.json') }}
48+
4249
- name: Install Python setuptools (node-gyp needs distutils, removed in Python 3.12)
50+
if: steps.cache-deps.outputs.cache-hit != 'true'
4351
run: pip3 install setuptools --break-system-packages
4452

4553
- name: Install dependencies
54+
if: steps.cache-deps.outputs.cache-hit != 'true'
4655
run: npm ci
4756

48-
# --- Nuxt build cache (platform-independent — shared across all 3 OS runners) ---
49-
# Key does NOT include runner.os: .output is pure JS and works on any platform.
50-
# Whichever runner builds first, the other two restore from cache and skip nuxt build.
57+
# On cache hit, npm ci (and its postinstall: nuxt prepare) was skipped
58+
- name: Prepare Nuxt types
59+
if: steps.cache-deps.outputs.cache-hit == 'true'
60+
run: npx nuxt prepare
61+
62+
# Nuxt build cache (platform-independent — shared across all 3 OS runners)
63+
# Key has no runner.os: .output is pure JS, identical on every platform.
64+
# Whichever runner builds first, the other two restore from cache and skip.
5165
- uses: actions/cache@v4
5266
id: cache-nuxt
5367
with:
@@ -58,7 +72,7 @@ jobs:
5872
if: steps.cache-nuxt.outputs.cache-hit != 'true'
5973
run: npx nuxt build
6074

61-
# --- Electron binary + electron-builder tools cache ---
75+
# Electron binary + electron-builder tools cache
6276
- uses: actions/cache@v4
6377
with:
6478
path: |

0 commit comments

Comments
 (0)