85 lines
2.3 KiB
YAML
85 lines
2.3 KiB
YAML
name: Test Web
|
|
|
|
on:
|
|
push:
|
|
branches: [master]
|
|
pull_request:
|
|
branches: [master]
|
|
|
|
jobs:
|
|
changes:
|
|
name: Paths filter
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
src: ${{ steps.filter.outputs.src }}
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: dorny/paths-filter@v2
|
|
id: filter
|
|
with:
|
|
filters: |
|
|
src:
|
|
- '!**.md'
|
|
|
|
build:
|
|
needs: changes
|
|
if: ${{ needs.changes.outputs.src == 'true' }}
|
|
name: Test Node.js ${{ matrix.node_version }} / Rust ${{ matrix.rust_version }} / ${{ matrix.os }}
|
|
runs-on: ${{ matrix.os }}
|
|
continue-on-error: ${{ matrix.rust_version == 'nightly' }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
node_version: ["12", "14"]
|
|
# We most likely don't care about Rust versions here, we'll catch those issues in test_rust.yml.
|
|
rust_version: [stable]
|
|
# MIKE: Turning off macOS-latest for now (flaky tests on CI).
|
|
os: [ubuntu-latest, windows-latest]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Setup Node.js ${{ matrix.node_version }}
|
|
uses: actions/setup-node@v2
|
|
with:
|
|
node-version: ${{ matrix.node_version }}
|
|
|
|
- name: Install Rust toolchain
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
profile: minimal
|
|
toolchain: ${{ matrix.rust_version }}
|
|
target: wasm32-unknown-unknown
|
|
|
|
# wasm-bindgen-cli version must match wasm-bindgen crate version.
|
|
# Be sure to update in release_nightly.yml, web/Cargo.toml and web/README.md.
|
|
- name: Install wasm-bindgen
|
|
run: cargo install wasm-bindgen-cli --version 0.2.77
|
|
|
|
- name: Setup conda
|
|
uses: conda-incubator/setup-miniconda@v2
|
|
with:
|
|
activate-environment: binaryen
|
|
|
|
# conda is available only with "shell: bash -l {0}".
|
|
# See https://github.com/marketplace/actions/setup-miniconda.
|
|
- name: Install binaryen
|
|
shell: bash -l {0}
|
|
run: conda install -c conda-forge binaryen
|
|
|
|
- name: Build
|
|
working-directory: web
|
|
shell: bash -l {0}
|
|
run: |
|
|
npm run bootstrap
|
|
npm run build
|
|
|
|
- name: Check formatting
|
|
working-directory: web
|
|
run: npm run lint
|
|
|
|
- name: Run tests
|
|
working-directory: web
|
|
run: npm test
|