Skip to content

Commit f271c1e

Browse files
authored
Add nodejs pipeline (#537)
1 parent 428b039 commit f271c1e

File tree

6 files changed

+41
-4
lines changed

6 files changed

+41
-4
lines changed

.github/workflows/nodejs.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Node.js CI
2+
permissions:
3+
contents: read
4+
5+
on:
6+
push:
7+
branches: [ main ]
8+
pull_request:
9+
branches: [ main ]
10+
11+
jobs:
12+
build:
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
matrix:
16+
os: [ubuntu-latest, windows-latest, macos-latest]
17+
# Test against multiple Node.js versions
18+
node-version: [20.x, 22.x, 24.x]
19+
arch: [x64]
20+
include:
21+
- os: ubuntu-latest
22+
arch: arm64
23+
steps:
24+
- uses: actions/checkout@v5
25+
- name: Use Node.js ${{ matrix.node-version }} on ${{ matrix.arch }}
26+
uses: actions/setup-node@v5
27+
with:
28+
node-version: ${{ matrix.node-version }}
29+
architecture: ${{ matrix.arch }}
30+
- name: Install dependencies
31+
run: npm install
32+
working-directory: js/quick-start_onnxruntime-node
33+
34+
- name: Run the example
35+
run: node .
36+
working-directory: js/quick-start_onnxruntime-node

js/api-usage_inference-session/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
"description": "This example is a demonstration of basic usage of InferenceSession.",
66
"main": "index.js",
77
"dependencies": {
8-
"onnxruntime-node": "^1.15.1"
8+
"onnxruntime-node": "^1.23.0"
99
}
1010
}

js/api-usage_tensor/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
"version": "1.0.0",
55
"description": "This example is a demonstration of basic usage of Tensor.",
66
"dependencies": {
7-
"onnxruntime-node": "^1.15.1"
7+
"onnxruntime-node": "^1.23.0"
88
}
99
}

js/quick-start_onnxruntime-node-bundler/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"dev": "webpack --config ./webpack.config.js --mode development"
99
},
1010
"dependencies": {
11-
"onnxruntime-node": "^1.15.1"
11+
"onnxruntime-node": "^1.23.0"
1212
},
1313
"devDependencies": {
1414
"copy-webpack-plugin": "^8.1.1",

js/quick-start_onnxruntime-node/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ async function main() {
2929
const dataC = results.c.data;
3030
console.log(`data of result tensor 'c': ${dataC}`);
3131

32+
await session.release()
3233
} catch (e) {
3334
console.error(`failed to inference ONNX model: ${e}.`);
3435
}

js/quick-start_onnxruntime-node/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
"description": "This example is a demonstration of basic usage of ONNX Runtime Node.js binding.",
66
"main": "index.js",
77
"dependencies": {
8-
"onnxruntime-node": "^1.15.1"
8+
"onnxruntime-node": "^1.23.0"
99
}
1010
}

0 commit comments

Comments
 (0)