Skip to content

Commit eb95520

Browse files
committed
Add CI for wasm build/test.
1 parent 2f1d09f commit eb95520

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/ci.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,43 @@ jobs:
8585
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
8686
- name: Run clippy
8787
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
88+
89+
wasm:
90+
name: WASM
91+
runs-on: ubuntu-latest
92+
steps:
93+
- uses: actions/checkout@v4
94+
with:
95+
lfs: true
96+
- name: Install Rust
97+
uses: dtolnay/rust-toolchain@stable
98+
with:
99+
targets: wasm32-unknown-unknown
100+
- name: Install Node.js
101+
uses: actions/setup-node@v4
102+
with:
103+
node-version: '20'
104+
- name: Install pnpm
105+
uses: pnpm/action-setup@v4
106+
with:
107+
version: 8
108+
- name: Cache cargo registry
109+
uses: actions/cache@v4
110+
with:
111+
path: |
112+
~/.cargo/registry
113+
~/.cargo/git
114+
~/.cargo/bin
115+
target
116+
key: ${{ runner.os }}-wasm-${{ hashFiles('**/Cargo.lock') }}
117+
- name: Install wasm-pack
118+
run: |
119+
if ! command -v wasm-pack &> /dev/null; then
120+
cargo install wasm-pack --locked
121+
fi
122+
- name: Build WASM package
123+
working-directory: broodrep-wasm
124+
run: pnpm run build
125+
- name: Test WASM package
126+
working-directory: broodrep-wasm
127+
run: pnpm run test

0 commit comments

Comments
 (0)