Publish node-addon-api wrapper for sherpa-onnx as npm packages (#829)
This commit is contained in:
66
.github/workflows/test-nodejs-addon-npm.yaml
vendored
Normal file
66
.github/workflows/test-nodejs-addon-npm.yaml
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
name: test-node-addon-npm
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- '.github/workflows/test-nodejs-addon-npm.yaml'
|
||||
- 'CMakeLists.txt'
|
||||
- 'cmake/**'
|
||||
- 'sherpa-onnx/csrc/*'
|
||||
- 'sherpa-onnx/c-api/*'
|
||||
- 'scripts/node-addon-api/**'
|
||||
- 'scripts/node-addon-api/*.js'
|
||||
- 'nodejs-addon-examples/package.json'
|
||||
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- '.github/workflows/test-nodejs-addon-npm.yaml'
|
||||
- 'CMakeLists.txt'
|
||||
- 'cmake/**'
|
||||
- 'sherpa-onnx/csrc/*'
|
||||
- 'sherpa-onnx/c-api/*'
|
||||
- 'scripts/node-addon-api/*.js'
|
||||
- 'nodejs-addon-examples/package.json'
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: test-node-addon-npm-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
test-node-addon-npm:
|
||||
name: ${{ matrix.os }} node v${{ matrix.node-version }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [macos-11, macos-14, ubuntu-20.04, ubuntu-22.04]
|
||||
node-version: ["16", "17", "18", "19", "21", "22"]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
node-version: ${{ matrix.node-version }}
|
||||
|
||||
- name: Display node version
|
||||
shell: bash
|
||||
run: |
|
||||
node --version
|
||||
|
||||
- name: Run tests
|
||||
shell: bash
|
||||
run: |
|
||||
.github/scripts/test-nodejs-addon-npm.sh
|
||||
Reference in New Issue
Block a user