-
Notifications
You must be signed in to change notification settings - Fork 24
83 lines (77 loc) · 2.3 KB
/
tests.yml
File metadata and controls
83 lines (77 loc) · 2.3 KB
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
name: Tests
on:
push:
branches: [ "main" ]
pull_request:
env:
CARGO_TERM_COLOR: always
UDEPS_VERSION: 0.1.50
NODE_VERSION: 20
jobs:
All:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Lint
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Fmt
run: cargo fmt --all -- --check
- name: Check docs
run: cargo doc --no-deps --document-private-items
env:
RUSTDOCFLAGS: "-D warnings"
- name: Run tests
run: cargo test --verbose
Dependencies:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- name: Install udeps
uses: taiki-e/install-action@cargo-udeps
- name: Check for unused dependencies
run: cargo udeps --all-targets
React:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
cache-dependency-path: explorer/package-lock.json
- name: Install wasm-pack
uses: taiki-e/install-action@wasm-pack
- name: Install dependencies
run: cd explorer && npm ci
- name: Test compilation
run: cd explorer && CI=true npm run build
WASM:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Build types
run: cargo build --target wasm32-unknown-unknown --release --manifest-path types/Cargo.toml && du -h target/wasm32-unknown-unknown/release/alto_types.wasm
- name: Install wasm-pack
uses: taiki-e/install-action@wasm-pack
- name: Pack types
run: wasm-pack build types --release --target web