-
Notifications
You must be signed in to change notification settings - Fork 2
59 lines (51 loc) · 1.57 KB
/
ci.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
name: Node.js CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache cargo build
uses: actions/cache@v4
with:
path: wasm/target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: rustfmt, clippy
- name: Install wasm-pack
uses: jetli/[email protected]
with:
version: 'latest'
- name: Install cargo-deny
uses: baptiste0928/cargo-install@v3
with:
crate: cargo-deny
version: "^0.14"
# `--force` flag is required because of pug@3 conflicting with pug-loader peer dependency.
# pug@3 works fine in practice.
- run: npm ci --force
# Rust-related checks
- name: Format
run: npm run lint:wasm:fmt
- name: Clippy
run: cargo clippy --manifest-path wasm/Cargo.toml --all-targets -- -D warnings
- name: Check dependencies
run: (cd wasm; cargo deny check)
- name: Tests
run: npm run test:wasm -- --chrome --firefox
# Front-end checks (`npm run build` should be the first one, it builds WASM)
- run: npm run build
- run: npm run lint:js
- run: npm run test:js