fix: ci #20
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
name: Test and build demo | |
on: | |
push: | |
branches: ["master"] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- uses: actions/setup-node@v4 | |
- name: Install | |
run: | | |
cargo install -f wasm-bindgen-cli wasm-opt | |
rustup target add wasm32-unknown-unknown | |
npm i | |
- name: Build wasm | |
run: npm run build:cargo &&npm run build | |
- name: Test Node.js | |
run: | | |
cd ${GITHUB_WORKSPACE}/demo/node | |
npm install | |
npm test | |
- name: Build web | |
run: | | |
cd ${GITHUB_WORKSPACE}/demo/web | |
npm install | |
PUBLIC_URL='/jieba-wasm/' npm run build | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./demo/web/dist |