ruffle/.github/workflows/test_web.yml

114 lines
2.9 KiB
YAML
Raw Normal View History

name: Test Web
on:
push:
2021-08-25 19:15:02 +00:00
branches: [master]
pull_request:
2021-08-25 19:15:02 +00:00
branches: [master]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
changes:
name: Paths filter
runs-on: ubuntu-22.04
outputs:
2023-08-26 10:58:31 +00:00
should_run: ${{ steps.filter.outputs.src }}
steps:
- uses: actions/checkout@v4
- uses: AurorNZ/paths-filter@v4
id: filter
with:
filters: |
src:
2023-08-26 10:58:31 +00:00
- '!**/*.md'
build:
needs: changes
2023-08-26 10:58:31 +00:00
if: needs.changes.outputs.should_run == 'true'
name: Test Node.js ${{ matrix.node_version }} / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
node_version: ["20", "22"]
os: [ubuntu-22.04, windows-latest]
steps:
- 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 }}
uses: actions/setup-node@v4
2021-08-25 19:15:02 +00:00
with:
node-version: ${{ matrix.node_version }}
cache: npm
cache-dependency-path: web/package-lock.json
2021-08-25 19:15:02 +00:00
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
2021-08-25 19:15:02 +00:00
with:
targets: wasm32-unknown-unknown
- name: Cache Cargo output
uses: Swatinem/rust-cache@v2
with:
shared-key: "web"
2023-09-06 20:56:24 +00:00
save-if: ${{ github.ref == 'refs/heads/master' }}
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
run: cargo install wasm-bindgen-cli --version 0.2.92
# Keep the version number in sync in all workflows,
# and in the extension builder Dockerfile!
- name: Install wasm-opt
uses: sigoden/install-binary@v1
2021-08-25 19:15:02 +00:00
with:
repo: WebAssembly/binaryen
tag: version_118
name: wasm-opt
2021-08-25 19:15:02 +00:00
- name: Build
env:
RUSTFLAGS: -D warnings
# Verify that all features build.
CARGO_FLAGS: --all-features
2021-08-25 19:15:02 +00:00
working-directory: web
shell: bash -l {0}
run: |
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
- name: Run node-based tests
2021-08-25 19:15:02 +00:00
working-directory: web
run: npm test
- name: Run browser-based tests
# Don't run browser tests on Windows because it's flaky for unknown reasons. :-(
if: runner.os == 'Linux'
working-directory: web
run: npm run wdio -- --headless --chrome --firefox --edge
check-required:
needs: changes
2023-08-26 10:58:31 +00:00
if: needs.changes.outputs.should_run == 'false'
name: Test Node.js ${{ matrix.node_version }} / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
2024-05-17 06:33:37 +00:00
node_version: ["20", "22"]
os: [ubuntu-22.04, windows-latest]
steps:
- name: No-op
run: echo noop