-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from Picovoice/initial-node
Initial NodeJS
- Loading branch information
Showing
41 changed files
with
5,440 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Node.js Codestyle | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [ main ] | ||
paths: | ||
- '**/nodejs/*.js' | ||
- '**/nodejs/*.ts' | ||
- '.github/workflows/nodejs-codestyle.yml' | ||
pull_request: | ||
branches: [ main, 'v[0-9]+.[0-9]+' ] | ||
paths: | ||
- '**/nodejs/*.js' | ||
- '**/nodejs/*.ts' | ||
- '.github/workflows/nodejs-codestyle.yml' | ||
|
||
jobs: | ||
check-nodejs-codestyle: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Node.js LTS | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: lts/* | ||
|
||
- name: Pre-build dependencies | ||
run: npm install yarn | ||
|
||
- name: Run Binding Linter | ||
run: yarn && yarn lint | ||
working-directory: binding/nodejs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Node.js Demos | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [ main ] | ||
paths: | ||
- 'demo/nodejs/**' | ||
- 'demo/expressjs/**' | ||
- '!demo/nodejs/README.md' | ||
- '!demo/expressjs/README.md' | ||
- 'lib/node/**' | ||
- '.github/workflows/nodejs-demos.yml' | ||
|
||
pull_request: | ||
branches: [ main, 'v[0-9]+.[0-9]+' ] | ||
paths: | ||
- 'demo/nodejs/**' | ||
- 'demo/expressjs/**' | ||
- '!demo/nodejs/README.md' | ||
- '!demo/expressjs/README.md' | ||
- 'lib/node/**' | ||
- '.github/workflows/nodejs-demos.yml' | ||
|
||
defaults: | ||
run: | ||
working-directory: demo/nodejs | ||
|
||
jobs: | ||
build-self-hosted: | ||
runs-on: ${{ matrix.machine }} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
machine: [rpi4-32, rpi4-64, rpi5-32, rpi5-64, pv-linux, pv-ios, pv-windows] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install and build Node Binding | ||
run: yarn && yarn build | ||
working-directory: binding/nodejs | ||
|
||
- name: Install dependencies | ||
run: yarn install | ||
|
||
- name: Download resource files | ||
run: curl http://${{secrets.PV_CICD_RES_SERVER_AUTHORITY}}/github/picollm/res/phi2-290.bin/latest/phi2-290.bin -o phi2-290.bin | ||
|
||
- name: Test | ||
run: yarn generate --access_key ${{secrets.PV_VALID_ACCESS_KEY}} --model_file_path phi2-290.bin --completion_token_limit 10 --generate "Hello my name is" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Node.js Tests | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [ main ] | ||
paths: | ||
- '.github/workflows/nodejs.yml' | ||
- 'binding/nodejs/**' | ||
- '!binding/nodejs/README.md' | ||
- 'lib/common/**' | ||
- 'lib/node/**' | ||
- 'resources/.test/**' | ||
|
||
pull_request: | ||
branches: [ main, 'v[0-9]+.[0-9]+' ] | ||
paths: | ||
- '.github/workflows/nodejs.yml' | ||
- 'binding/nodejs/**' | ||
- '!binding/nodejs/README.md' | ||
- 'lib/common/**' | ||
- 'lib/node/**' | ||
- 'resources/.test/**' | ||
|
||
defaults: | ||
run: | ||
working-directory: binding/nodejs | ||
|
||
jobs: | ||
build-self-hosted: | ||
runs-on: ${{ matrix.machine }} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
machine: [rpi4-32, rpi4-64, rpi5-32, rpi5-64, pv-linux, pv-ios, pv-windows] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install dependencies | ||
run: yarn install | ||
|
||
- name: Download resource files | ||
run: curl http://${{secrets.PV_CICD_RES_SERVER_AUTHORITY}}/github/picollm/res/phi2-290.bin/latest/phi2-290.bin -o phi2-290.bin | ||
|
||
- name: Test | ||
run: yarn test test/index.test.ts --access_key=${{secrets.PV_VALID_ACCESS_KEY}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
node_modules | ||
dist | ||
lib | ||
resources | ||
.eslintrc.js |
Oops, something went wrong.