Skip to content

Commit

Permalink
Initial web (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
laves authored Apr 25, 2024
1 parent 694a4bc commit e989be9
Show file tree
Hide file tree
Showing 123 changed files with 19,935 additions and 24 deletions.
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

0 comments on commit e989be9

Please sign in to comment.