Skip to content

Commit 5491139

Browse files
authored
chore: upgrade deps (#29)
1 parent 3930d8e commit 5491139

File tree

6 files changed

+139
-84
lines changed

6 files changed

+139
-84
lines changed

.github/workflows/pure-rust-build-on-linux.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,15 @@ jobs:
3232
runs-on: ubuntu-latest
3333
steps:
3434
- uses: actions/checkout@v4
35+
- name: Cache cargo registry
36+
uses: actions/cache@v4
37+
with:
38+
path: |
39+
~/.cargo
40+
${{ github.workspace }}/.xwin
41+
~/.napi-rs
42+
./target
43+
key: ${{ matrix.targets }}-cargo-cache
3544
- name: Install
3645
uses: dtolnay/rust-toolchain@stable
3746
with:
@@ -45,9 +54,16 @@ jobs:
4554
uses: goto-bus-stop/setup-zig@v1
4655
with:
4756
version: 0.13.0
48-
- run: cargo install cargo-xwin
57+
- name: Install cargo toolchains
58+
uses: taiki-e/install-action@v2
59+
env:
60+
GITHUB_TOKEN: ${{ github.token }}
61+
with:
62+
tool: cargo-zigbuild,cargo-xwin
4963
- run: yarn install
5064
- run: yarn workspace @napi-cross-build/01-pure-rust build --target ${{ matrix.targets }}
65+
env:
66+
XWIN_CACHE_DIR: ${{ github.workspace }}/.xwin
5167
- uses: actions/upload-artifact@v4
5268
with:
5369
name: bindings-${{ matrix.targets }}
@@ -131,7 +147,7 @@ jobs:
131147
- uses: actions/checkout@v4
132148
- uses: actions/setup-node@v4
133149
with:
134-
node-version: 18
150+
node-version: 20
135151
cache: 'yarn'
136152
- name: Install dependencies
137153
run: yarn install

01-pure-rust/__test__/index.spec.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import test from 'ava'
2-
import lz from 'lz-string'
32

43
import { compressToBase64 } from '../index.js'
54

01-pure-rust/index.js

Lines changed: 61 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,14 +224,72 @@ switch (platform) {
224224
}
225225
break
226226
case 'arm':
227+
if (isMusl()) {
228+
localFileExisted = existsSync(
229+
join(__dirname, '01-pure-rust.linux-arm-musleabihf.node')
230+
)
231+
try {
232+
if (localFileExisted) {
233+
nativeBinding = require('./01-pure-rust.linux-arm-musleabihf.node')
234+
} else {
235+
nativeBinding = require('@napi-cross-build/01-pure-rust-linux-arm-musleabihf')
236+
}
237+
} catch (e) {
238+
loadError = e
239+
}
240+
} else {
241+
localFileExisted = existsSync(
242+
join(__dirname, '01-pure-rust.linux-arm-gnueabihf.node')
243+
)
244+
try {
245+
if (localFileExisted) {
246+
nativeBinding = require('./01-pure-rust.linux-arm-gnueabihf.node')
247+
} else {
248+
nativeBinding = require('@napi-cross-build/01-pure-rust-linux-arm-gnueabihf')
249+
}
250+
} catch (e) {
251+
loadError = e
252+
}
253+
}
254+
break
255+
case 'riscv64':
256+
if (isMusl()) {
257+
localFileExisted = existsSync(
258+
join(__dirname, '01-pure-rust.linux-riscv64-musl.node')
259+
)
260+
try {
261+
if (localFileExisted) {
262+
nativeBinding = require('./01-pure-rust.linux-riscv64-musl.node')
263+
} else {
264+
nativeBinding = require('@napi-cross-build/01-pure-rust-linux-riscv64-musl')
265+
}
266+
} catch (e) {
267+
loadError = e
268+
}
269+
} else {
270+
localFileExisted = existsSync(
271+
join(__dirname, '01-pure-rust.linux-riscv64-gnu.node')
272+
)
273+
try {
274+
if (localFileExisted) {
275+
nativeBinding = require('./01-pure-rust.linux-riscv64-gnu.node')
276+
} else {
277+
nativeBinding = require('@napi-cross-build/01-pure-rust-linux-riscv64-gnu')
278+
}
279+
} catch (e) {
280+
loadError = e
281+
}
282+
}
283+
break
284+
case 's390x':
227285
localFileExisted = existsSync(
228-
join(__dirname, '01-pure-rust.linux-arm-gnueabihf.node')
286+
join(__dirname, '01-pure-rust.linux-s390x-gnu.node')
229287
)
230288
try {
231289
if (localFileExisted) {
232-
nativeBinding = require('./01-pure-rust.linux-arm-gnueabihf.node')
290+
nativeBinding = require('./01-pure-rust.linux-s390x-gnu.node')
233291
} else {
234-
nativeBinding = require('@napi-cross-build/01-pure-rust-linux-arm-gnueabihf')
292+
nativeBinding = require('@napi-cross-build/01-pure-rust-linux-s390x-gnu')
235293
}
236294
} catch (e) {
237295
loadError = e

01-pure-rust/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@
2222
"license": "MIT",
2323
"devDependencies": {
2424
"@napi-rs/cli": "2.18.4",
25-
"ava": "^6.0.0",
26-
"lz-string": "^1.5.0"
25+
"ava": "^6.1.3"
2726
},
2827
"ava": {
2928
"timeout": "3m"

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
[workspace]
22
members = ["01-pure-rust"]
3+
resolver = "2"
34

45
[profile.release]
56
lto = true
7+
strip = "symbols"

0 commit comments

Comments
 (0)