Enable browser / cross-platform support #46
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: CI | |
on: | |
push: | |
branches: | |
- main | |
- master | |
pull_request: {} | |
concurrency: | |
group: ci-${{ github.head_ref || github.ref }} | |
cancel-in-progress: true | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Cache Crates | |
uses: actions/cache@v3 | |
with: | |
path: | | |
./target | |
~/.cargo | |
key: debug-${{ runner.os }}-${{ hashFiles('rust-toolchain') }}-${{ hashFiles('Cargo.lock') }} | |
restore-keys: | | |
debug-${{ runner.os }}-${{ hashFiles('rust-toolchain') }}- | |
debug-${{ runner.os }}- | |
- name: Run tests | |
run: cargo test --verbose | |
- name: Install wasm-pack | |
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh | |
- name: Install wasm-opt | |
run: cargo install wasm-opt | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
cache: 'npm' | |
# requires node for text replacements | |
- run: ./build.sh | |
- run: npm ci | |
- run: npm test |