-
Notifications
You must be signed in to change notification settings - Fork 7
77 lines (61 loc) · 1.93 KB
/
rust.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
name: Rust
on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Cache installation of tools
uses: actions/cache@v3
with:
path: |
~/.cargo
~/.rustup
key: ${{ runner.os }}-installation
- name: Add wasm32 target
run: rustup target add wasm32-unknown-unknown
- name: Add wasm32-wasi target
run: rustup target add wasm32-wasi
- name: Install wasm-pack
run: cargo install --version 0.12.1 wasm-pack
- name: Install cargo component
run: cargo install --version 0.5.0 cargo-component
- uses: actions/checkout@v3
- name: Cache build folders
uses: actions/cache@v3
with:
path: |
Cargo.lock
target
tests/instance
key: ${{ runner.os }}-build-folders-${{ hashFiles('Cargo.toml', 'crates/*/Cargo.toml') }}
restore-keys: ${{ runner.os }}-build-folders
- name: Run unit tests
env:
RUSTFLAGS: "-D warnings"
run: cd crates/wasm-bridge && wasm-pack test --node -- --all-features
- name: Run wasi unit tests
env:
RUSTFLAGS: "-D warnings"
run: cd crates/wasm-bridge-wasi && wasm-pack test --node -- --all-features
- name: Check formatting
env:
RUSTFLAGS: "-D warnings"
run: cargo fmt --all -- --check
- name: Check compile warnings
env:
RUSTFLAGS: "-D warnings"
run: cargo check --target wasm32-unknown-unknown --all-features
- name: Check clippy warnings
env:
RUSTFLAGS: "-D warnings"
run: cargo clippy --target wasm32-unknown-unknown --all-features -- -D clippy::all
- name: Run tests
env:
RUSTFLAGS: "-D warnings"
run: cd tests && bash run_all_tests.sh