Skip to content

Commit 5e07d2f

Browse files
committed
ci: install native version of swc for testing
1 parent 7495fd8 commit 5e07d2f

File tree

3 files changed

+16
-9
lines changed

3 files changed

+16
-9
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,14 @@ jobs:
3636
node-version: ${{ matrix.node-version }}
3737

3838
- name: Install dependencies
39-
run: npm ci
39+
run: |
40+
npm ci
41+
# `@swc/core` has a postinstall hook that in GHA pulls in the wasm version of swc. This pulls in the native
42+
# binary version instead, which is faster and more reliable. Also, the wasm version seems to fail with a
43+
# strange serde error in CI. ("Error: invalid type: unit value, expected struct Options")
44+
# See: https://github.com/swc-project/swc/blob/main/postinstall.js#L197-L200
45+
core_version="$(jq --raw-output '.packages."node_modules/@swc/core".optionalDependencies."@swc/core-linux-x64-gnu"' < ./package-lock.json)"
46+
npm install -no-save --loglevel=error --prefer-offline --no-audit --progress=false "@swc/core-linux-x64-gnu@${core_version}"
4047
4148
- name: Restore Turbo Cache
4249
uses: actions/cache@v3

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/openapi-generator/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@
2929
"resolve": "1.22.4"
3030
},
3131
"devDependencies": {
32-
"@swc-node/register": "^1.6.6",
33-
"@swc/core": "^1.3.76",
34-
"@types/resolve": "^1.20.2",
32+
"@swc-node/register": "1.6.6",
33+
"@swc/core": "1.3.76",
34+
"@types/resolve": "1.20.2",
3535
"c8": "8.0.1",
36-
"memfs": "^4.2.1",
36+
"memfs": "4.2.1",
3737
"typescript": "4.7.4"
3838
},
3939
"publishConfig": {

0 commit comments

Comments
 (0)