2020-05-18 08:56:05 +00:00
|
|
|
name: Test Web
|
2020-05-09 12:59:27 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2021-08-25 19:15:02 +00:00
|
|
|
branches: [master]
|
2020-05-09 12:59:27 +00:00
|
|
|
pull_request:
|
2021-08-25 19:15:02 +00:00
|
|
|
branches: [master]
|
2020-05-09 12:59:27 +00:00
|
|
|
|
2023-01-16 01:57:10 +00:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2020-05-09 12:59:27 +00:00
|
|
|
jobs:
|
2021-08-25 19:03:43 +00:00
|
|
|
changes:
|
|
|
|
name: Paths filter
|
2022-08-17 15:56:24 +00:00
|
|
|
runs-on: ubuntu-22.04
|
2021-08-25 19:03:43 +00:00
|
|
|
outputs:
|
2023-08-26 10:58:31 +00:00
|
|
|
should_run: ${{ steps.filter.outputs.src }}
|
2021-08-25 19:03:43 +00:00
|
|
|
steps:
|
2023-10-01 01:04:37 +00:00
|
|
|
- uses: actions/checkout@v4
|
2021-08-25 21:09:14 +00:00
|
|
|
|
2024-01-30 02:39:10 +00:00
|
|
|
- uses: AurorNZ/paths-filter@v4
|
2021-08-25 19:03:43 +00:00
|
|
|
id: filter
|
|
|
|
with:
|
|
|
|
filters: |
|
|
|
|
src:
|
2023-08-26 10:58:31 +00:00
|
|
|
- '!**/*.md'
|
2021-08-25 19:03:43 +00:00
|
|
|
|
2020-05-09 12:59:27 +00:00
|
|
|
build:
|
2021-08-25 19:03:43 +00:00
|
|
|
needs: changes
|
2023-08-26 10:58:31 +00:00
|
|
|
if: needs.changes.outputs.should_run == 'true'
|
2024-02-14 10:38:57 +00:00
|
|
|
name: Test Node.js ${{ matrix.node_version }} / ${{ matrix.os }}
|
2020-05-09 12:59:27 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2024-05-17 06:33:37 +00:00
|
|
|
node_version: ["20", "22"]
|
2022-08-17 15:56:24 +00:00
|
|
|
os: [ubuntu-22.04, windows-latest]
|
2020-05-09 12:59:27 +00:00
|
|
|
|
|
|
|
steps:
|
2023-10-01 01:04:37 +00:00
|
|
|
- uses: actions/checkout@v4
|
2021-02-01 03:07:36 +00:00
|
|
|
|
2021-08-25 19:15:02 +00:00
|
|
|
- name: Setup Node.js ${{ matrix.node_version }}
|
2023-11-01 10:19:14 +00:00
|
|
|
uses: actions/setup-node@v4
|
2021-08-25 19:15:02 +00:00
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node_version }}
|
2022-01-12 06:43:18 +00:00
|
|
|
cache: npm
|
|
|
|
cache-dependency-path: web/package-lock.json
|
2020-05-09 12:59:27 +00:00
|
|
|
|
2021-08-25 19:15:02 +00:00
|
|
|
- name: Install Rust toolchain
|
2022-12-01 21:24:04 +00:00
|
|
|
uses: dtolnay/rust-toolchain@stable
|
2021-08-25 19:15:02 +00:00
|
|
|
with:
|
2022-12-01 21:24:04 +00:00
|
|
|
targets: wasm32-unknown-unknown
|
2020-05-09 12:59:27 +00:00
|
|
|
|
2022-08-26 18:38:58 +00:00
|
|
|
- name: Cache Cargo output
|
2022-12-01 22:02:44 +00:00
|
|
|
uses: Swatinem/rust-cache@v2
|
2022-08-26 18:38:58 +00:00
|
|
|
with:
|
|
|
|
shared-key: "web"
|
2023-09-06 20:56:24 +00:00
|
|
|
save-if: ${{ github.ref == 'refs/heads/master' }}
|
2022-08-26 18:38:58 +00:00
|
|
|
|
2021-08-25 19:15:02 +00:00
|
|
|
# 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
|
2024-03-04 10:28:29 +00:00
|
|
|
run: cargo install wasm-bindgen-cli --version 0.2.92
|
2021-01-15 20:59:25 +00:00
|
|
|
|
2021-08-25 19:15:02 +00:00
|
|
|
- name: Setup conda
|
2023-12-01 01:12:24 +00:00
|
|
|
uses: conda-incubator/setup-miniconda@v3
|
2021-08-25 19:15:02 +00:00
|
|
|
with:
|
|
|
|
activate-environment: binaryen
|
2021-01-15 20:59:25 +00:00
|
|
|
|
2021-08-25 19:15:02 +00:00
|
|
|
# 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
|
2020-05-09 12:59:27 +00:00
|
|
|
|
2021-08-25 19:15:02 +00:00
|
|
|
- name: Build
|
2022-07-30 03:08:22 +00:00
|
|
|
env:
|
2023-03-24 21:09:57 +00:00
|
|
|
RUSTFLAGS: -D warnings
|
2022-07-30 03:08:22 +00:00
|
|
|
# Verify that all features build.
|
2023-10-28 00:07:13 +00:00
|
|
|
CARGO_FLAGS: --all-features
|
2021-08-25 19:15:02 +00:00
|
|
|
working-directory: web
|
|
|
|
shell: bash -l {0}
|
|
|
|
run: |
|
2022-01-10 21:07:10 +00:00
|
|
|
npm ci
|
2021-08-25 19:15:02 +00:00
|
|
|
npm run build
|
2021-02-01 03:07:36 +00:00
|
|
|
|
2021-08-25 19:15:02 +00:00
|
|
|
- name: Check formatting
|
|
|
|
working-directory: web
|
|
|
|
run: npm run lint
|
2021-08-21 10:12:58 +00:00
|
|
|
|
2021-08-25 19:15:02 +00:00
|
|
|
- name: Run tests
|
2022-05-06 20:09:03 +00:00
|
|
|
# MIKE: Don't run web tests on Windows because it's flaky for unknown reasons. :-(
|
|
|
|
if: runner.os == 'Linux'
|
2021-08-25 19:15:02 +00:00
|
|
|
working-directory: web
|
|
|
|
run: npm test
|
2021-09-21 19:01:51 +00:00
|
|
|
|
|
|
|
check-required:
|
|
|
|
needs: changes
|
2023-08-26 10:58:31 +00:00
|
|
|
if: needs.changes.outputs.should_run == 'false'
|
2024-04-02 16:08:09 +00:00
|
|
|
name: Test Node.js ${{ matrix.node_version }} / ${{ matrix.os }}
|
2021-09-21 19:01:51 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2024-05-17 06:33:37 +00:00
|
|
|
node_version: ["20", "22"]
|
2022-08-17 15:56:24 +00:00
|
|
|
os: [ubuntu-22.04, windows-latest]
|
2021-09-21 19:01:51 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: No-op
|
|
|
|
run: echo noop
|