Skip to content

Commit

Permalink
Update CI for nodejs
Browse files Browse the repository at this point in the history
  • Loading branch information
csukuangfj committed Feb 24, 2024
1 parent d587069 commit 325621d
Showing 1 changed file with 23 additions and 46 deletions.
69 changes: 23 additions & 46 deletions .github/workflows/nodejs.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,16 @@
name: nodejs

on:
push:
branches:
- master
paths:
- '.github/workflows/nodejs.yaml'
- 'CMakeLists.txt'
- 'cmake/**'
- 'nodejs-examples/**'
- 'sherpa-ncnn/csrc/*'
pull_request:
branches:
- master
paths:
- '.github/workflows/nodejs.yaml'
- 'CMakeLists.txt'
- 'cmake/**'
- 'nodejs-examples/**'
- 'sherpa-ncnn/csrc/*'
workflow_dispatch:

schedule:
# minute (0-59)
# hour (0-23)
# day of the month (1-31)
# month (1-12)
# day of the week (0-6)
# nightly test at 22:50 UTC time every day
- cron: "50 22 * * *"

concurrency:
group: nodejs-${{ github.ref }}
Expand All @@ -33,63 +25,48 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.8"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 13
registry-url: 'https://registry.npmjs.org'

- name: Display node version
shell: bash
run: |
node --version
npm --version
cd nodejs-examples
npm install [email protected] -g
npm install [email protected]
npm --version
- name: Install npm packages
shell: bash
run: |
cd nodejs-examples
npm install ffi-napi ref-struct-napi wav
npm install npm
npm --version
npm list
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ matrix.os }}-shared

- name: Download model
shell: bash
run: |
cd nodejs-examples
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/csukuangfj/sherpa-ncnn-streaming-zipformer-bilingual-zh-en-2023-02-13
cd sherpa-ncnn-streaming-zipformer-bilingual-zh-en-2023-02-13
git lfs pull --include "*.bin"
ls -lh
curl -OL https://github.com/k2-fsa/sherpa-ncnn/releases/download/models/sherpa-ncnn-streaming-zipformer-bilingual-zh-en-2023-02-13.tar.bz2
tar xvf sherpa-ncnn-streaming-zipformer-bilingual-zh-en-2023-02-13.tar.bz2
rm sherpa-ncnn-streaming-zipformer-bilingual-zh-en-2023-02-13.tar.bz2
ls -lh sherpa-ncnn-streaming-zipformer-bilingual-zh-en-2023-02-13
- name: Test
shell: bash
run: |
export CMAKE_CXX_COMPILER_LAUNCHER=ccache
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
cmake --version
cd nodejs-examples
ls -lh
./run.sh
node ./decode-file.js

0 comments on commit 325621d

Please sign in to comment.