Skip to content

Commit

Permalink
chore: upgrade deps
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn committed Jul 22, 2024
1 parent 3930d8e commit c3f0508
Show file tree
Hide file tree
Showing 6 changed files with 139 additions and 84 deletions.
20 changes: 18 additions & 2 deletions .github/workflows/pure-rust-build-on-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo
${{ github.workspace }}/.xwin
~/.napi-rs
./target
key: ${{ matrix.targets }}-cargo-cache
- name: Install
uses: dtolnay/rust-toolchain@stable
with:
Expand All @@ -45,9 +54,16 @@ jobs:
uses: goto-bus-stop/setup-zig@v1
with:
version: 0.13.0
- run: cargo install cargo-xwin
- name: Install cargo toolchains
uses: taiki-e/install-action@v2
env:
GITHUB_TOKEN: ${{ github.token }}
with:
tool: cargo-zigbuild,cargo-xwin
- run: yarn install
- run: yarn workspace @napi-cross-build/01-pure-rust build --target ${{ matrix.targets }}
env:
XWIN_CACHE_DIR: ${{ github.workspace }}/.xwin
- uses: actions/upload-artifact@v4
with:
name: bindings-${{ matrix.targets }}
Expand Down Expand Up @@ -131,7 +147,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
cache: 'yarn'
- name: Install dependencies
run: yarn install
Expand Down
1 change: 0 additions & 1 deletion 01-pure-rust/__test__/index.spec.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import test from 'ava'
import lz from 'lz-string'

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

Expand Down
64 changes: 61 additions & 3 deletions 01-pure-rust/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,14 +224,72 @@ switch (platform) {
}
break
case 'arm':
if (isMusl()) {
localFileExisted = existsSync(
join(__dirname, '01-pure-rust.linux-arm-musleabihf.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./01-pure-rust.linux-arm-musleabihf.node')
} else {
nativeBinding = require('@napi-cross-build/01-pure-rust-linux-arm-musleabihf')
}
} catch (e) {
loadError = e
}
} else {
localFileExisted = existsSync(
join(__dirname, '01-pure-rust.linux-arm-gnueabihf.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./01-pure-rust.linux-arm-gnueabihf.node')
} else {
nativeBinding = require('@napi-cross-build/01-pure-rust-linux-arm-gnueabihf')
}
} catch (e) {
loadError = e
}
}
break
case 'riscv64':
if (isMusl()) {
localFileExisted = existsSync(
join(__dirname, '01-pure-rust.linux-riscv64-musl.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./01-pure-rust.linux-riscv64-musl.node')
} else {
nativeBinding = require('@napi-cross-build/01-pure-rust-linux-riscv64-musl')
}
} catch (e) {
loadError = e
}
} else {
localFileExisted = existsSync(
join(__dirname, '01-pure-rust.linux-riscv64-gnu.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./01-pure-rust.linux-riscv64-gnu.node')
} else {
nativeBinding = require('@napi-cross-build/01-pure-rust-linux-riscv64-gnu')
}
} catch (e) {
loadError = e
}
}
break
case 's390x':
localFileExisted = existsSync(
join(__dirname, '01-pure-rust.linux-arm-gnueabihf.node')
join(__dirname, '01-pure-rust.linux-s390x-gnu.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./01-pure-rust.linux-arm-gnueabihf.node')
nativeBinding = require('./01-pure-rust.linux-s390x-gnu.node')
} else {
nativeBinding = require('@napi-cross-build/01-pure-rust-linux-arm-gnueabihf')
nativeBinding = require('@napi-cross-build/01-pure-rust-linux-s390x-gnu')
}
} catch (e) {
loadError = e
Expand Down
3 changes: 1 addition & 2 deletions 01-pure-rust/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
"license": "MIT",
"devDependencies": {
"@napi-rs/cli": "2.18.4",
"ava": "^6.0.0",
"lz-string": "^1.5.0"
"ava": "^6.1.3"
},
"ava": {
"timeout": "3m"
Expand Down
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[workspace]
members = ["01-pure-rust"]
resolver = "2"

[profile.release]
lto = true
strip = "symbols"
Loading

0 comments on commit c3f0508

Please sign in to comment.