Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,24 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
# NOTE: "cache: npm" is intentionally omitted.
# Restoring a stale npm cache can cause platform-specific optional
# dependencies (e.g. @rollup/rollup-linux-x64-gnu) to be skipped
# during `npm ci`, leading to a Vitest startup error.
# See: https://github.com/npm/cli/issues/4828

- name: Install dependencies
run: npm ci

# Defensive guard: if the Rollup Linux native binary is still missing
# after `npm ci` (known npm optional-dep bug), wipe node_modules and
# reinstall from scratch so the next steps don't fail.
- name: Verify Rollup native module (clean reinstall if missing)
run: |
node -e "require('@rollup/rollup-linux-x64-gnu')" 2>/dev/null || \
(echo "::warning::@rollup/rollup-linux-x64-gnu missing – performing clean reinstall" && \
rm -rf node_modules && npm ci)

- name: Run unit tests
run: npm test

Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,24 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
# NOTE: "cache: npm" is intentionally omitted.
# Restoring a stale npm cache can cause platform-specific optional
# dependencies (e.g. @rollup/rollup-linux-x64-gnu) to be skipped
# during `npm ci`, leading to a Vitest startup error.
# See: https://github.com/npm/cli/issues/4828

- name: Install dependencies
run: npm ci

# Defensive guard: if the Rollup Linux native binary is still missing
# after `npm ci` (known npm optional-dep bug), wipe node_modules and
# reinstall from scratch so the next steps don't fail.
- name: Verify Rollup native module (clean reinstall if missing)
run: |
node -e "require('@rollup/rollup-linux-x64-gnu')" 2>/dev/null || \
(echo "::warning::@rollup/rollup-linux-x64-gnu missing – performing clean reinstall" && \
rm -rf node_modules && npm ci)

- name: Run tests
run: npm test

Expand Down
Loading
Loading