Skip to content

docs(mrml-core): update code in example #36

docs(mrml-core): update code in example

docs(mrml-core): update code in example #36

on:
push:
paths:
- .github/workflows/mrml-wasm-*
- packages/mrml-wasm/**
- packages/mrml-core/**
- Cargo.lock
- Cargo.toml
defaults:
run:
working-directory: packages/mrml-wasm
env:
RUSTFLAGS: "-Dwarnings"
jobs:
testing:
runs-on: ubuntu-latest
container: rust:1-bullseye
concurrency:
group: ${{ github.ref }}-mrml-wasm-testing
cancel-in-progress: true
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
- uses: actions/setup-node@v3
with:
node-version: latest
- name: install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-mrml-wasm-testing-${{ hashFiles('**/Cargo.lock') }}
- name: run unit tests
run: cargo test
- name: run integration tests
run: wasm-pack test --node
- name: build for nodejs
run: wasm-pack build --target nodejs
- name: run node example
run: |
cd examples/node
npm install
npm test
- name: run browser example tests
run: |
cd examples/browser
npm install
npm test