Skip to content

Commit 6bc8b74

Browse files
[test] Add a build test for Web-XGrammar. (#457)
As mentioned in #456, this PR adds a new workflow to test the build of Web-XGrammar. This PR should be merged after #456. At current, tests for Web-XGrammar will fail, and it may need further maintenance in the future. --------- Signed-off-by: Yuchuan <[email protected]>
1 parent c1f156a commit 6bc8b74

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Build Web-XGrammar
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
push:
7+
branches:
8+
- main
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
with:
17+
submodules: recursive
18+
19+
- name: Build emsdk
20+
run: |
21+
git clone https://github.com/emscripten-core/emsdk.git
22+
cd emsdk
23+
./emsdk install latest
24+
./emsdk activate latest
25+
26+
- name: Build Web-XGrammar
27+
run: |
28+
source ./emsdk/emsdk_env.sh
29+
echo "set(XGRAMMAR_BUILD_PYTHON_BINDINGS OFF)" >> cmake/config.cmake
30+
cd web
31+
npm install
32+
npm run build
33+
34+
# TODO(Linzhang): Tests will fail currently. Need further maintenance.
35+
# - name: Run tests
36+
# run: |
37+
# cd web
38+
# npm test

0 commit comments

Comments
 (0)