-
-
Notifications
You must be signed in to change notification settings - Fork 829
110 lines (93 loc) · 2.85 KB
/
test_web.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: Test Web
on:
push:
branches: [master]
pull_request:
branches: [master]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
changes:
name: Paths filter
runs-on: ubuntu-22.04
outputs:
should_run: ${{ steps.filter.outputs.src }}
steps:
- uses: actions/checkout@v4
- uses: AurorNZ/paths-filter@v4
id: filter
with:
filters: |
src:
- '!**/*.md'
build:
needs: changes
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
- name: Setup Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
cache: npm
cache-dependency-path: web/package-lock.json
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- name: Cache Cargo output
uses: Swatinem/rust-cache@v2
with:
shared-key: "web"
save-if: ${{ github.ref == 'refs/heads/master' }}
# 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
- name: Setup conda
uses: conda-incubator/setup-miniconda@v3
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
env:
RUSTFLAGS: -D warnings
# Verify that all features build.
CARGO_FLAGS: --all-features
working-directory: web
shell: bash -l {0}
run: |
npm ci
npm run build
- name: Check formatting
working-directory: web
run: npm run lint
- name: Run tests
# MIKE: Don't run web tests on Windows because it's flaky for unknown reasons. :-(
if: runner.os == 'Linux'
working-directory: web
run: npm test
check-required:
needs: changes
if: needs.changes.outputs.should_run == 'false'
name: Test Node.js ${{ matrix.node_version }} / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
node_version: ["20", "22"]
os: [ubuntu-22.04, windows-latest]
steps:
- name: No-op
run: echo noop