Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial web #6

Merged
merged 10 commits into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/web-codestyle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Web Codestyle

on:
workflow_dispatch:
push:
branches: [ main ]
paths:
- '**/web/*.js'
- '**/web/*.ts'
- '.github/workflows/web-codestyle.yml'
pull_request:
branches: [ main, 'v[0-9]+.[0-9]+' ]
paths:
- '**/web/*.js'
- '**/web/*.ts'
- '.github/workflows/web-codestyle.yml'

jobs:
check-web-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/web
41 changes: 41 additions & 0 deletions .github/workflows/web-demos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Web Demos

on:
workflow_dispatch:
push:
branches: [ main ]
paths:
- 'demo/web/**'
- '!demo/web/README.md'
- '.github/workflows/web-demos.yml'
pull_request:
branches: [ main, 'v[0-9]+.[0-9]+' ]
paths:
- 'demo/web/**'
- '!demo/web/README.md'
- '.github/workflows/web-demos.yml'

defaults:
run:
working-directory: demo/web

jobs:
build:
runs-on: ${{ matrix.machine }}

strategy:
matrix:
machine: [pv-linux, pv-ios, pv-windows]

steps:
- uses: actions/checkout@v3

- name: Install and build Web Binding
run: yarn && yarn copywasm && yarn build
working-directory: binding/web

- name: Setup demo
run: yarn setup-demo http://${{secrets.PV_CICD_RES_SERVER_AUTHORITY}}/github/xpu/res/phi2-290.bin/latest/phi2-290.bin phi2-290.bin

- name: Install dependencies
run: yarn install
48 changes: 48 additions & 0 deletions .github/workflows/web.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Web

on:
workflow_dispatch:
push:
branches: [ main ]
paths:
- 'binding/web/**'
- '!binding/web/README.md'
- 'lib/wasm/**'
- '.github/workflows/web.yml'
pull_request:
branches: [ main, 'v[0-9]+.[0-9]+' ]
paths:
- 'binding/web/**'
- '!binding/web/README.md'
- 'lib/wasm/**'
- '.github/workflows/web.yml'

defaults:
run:
working-directory: binding/web

jobs:
build:
runs-on: ${{ matrix.machine }}

strategy:
matrix:
machine: [pv-linux, pv-ios, pv-windows]

steps:
- uses: actions/checkout@v3

- name: Install dependencies
run: yarn install

- name: Copy libs
run: yarn copywasm

- name: Build
run: yarn build

- name: Prepare Test
run: yarn setup-test http://${{secrets.PV_CICD_RES_SERVER_AUTHORITY}}/github/picollm/res/phi2-290.bin/latest/phi2-290.bin phi2-290.bin

- name: Test Web Worker
run: yarn test --env ACCESS_KEY=${{secrets.PV_VALID_ACCESS_KEY}}
4 changes: 4 additions & 0 deletions binding/web/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"presets": ["@babel/preset-env"],
"plugins": ["@babel/plugin-transform-runtime"]
}
5 changes: 5 additions & 0 deletions binding/web/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
dist
lib
rollup.config.js
.eslintrc.js
Loading
Loading