From 06fcfa29ac963f75855a1fe2affa5a6b465444b8 Mon Sep 17 00:00:00 2001 From: Maurice Date: Sun, 31 May 2026 20:37:26 +0200 Subject: [PATCH] Install @swc/core's Linux binary explicitly in the server CI job Neither npm ci nor npm install fetched @swc/core-linux-x64-gnu on the Linux runner because the lockfile was generated on Windows and lacks the Linux optional-dep metadata. Add a step that installs the matching @swc/core-linux-x64-gnu version (no-save, no-lockfile) so unplugin-swc can load the server's vitest config. --- .github/workflows/test.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 763242b5..081285f0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -49,11 +49,16 @@ jobs: cache-dependency-path: package-lock.json - name: Install dependencies - # npm install (not ci) so npm re-resolves and installs @swc/core's - # platform-specific native binary for the Linux runner — server tests - # transform via unplugin-swc, and the committed lockfile omits the - # Linux optional dep that `npm ci` would otherwise need. - run: npm install + run: npm ci + + - name: Ensure @swc/core's Linux binary for unplugin-swc + # The lockfile was generated on Windows and omits @swc/core's Linux + # optional native binary, so npm ci/install skips it on the runner. + # Install the matching version explicitly so the server's SWC transform + # (server/vitest.config.ts) can load. + run: | + SWC_VERSION=$(node -p "require('@swc/core/package.json').version") + npm install --no-save --no-package-lock "@swc/core-linux-x64-gnu@$SWC_VERSION" - name: Build shared run: npm run build --workspace=shared