-
Notifications
You must be signed in to change notification settings - Fork 18
91 lines (75 loc) · 2.12 KB
/
test.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
---
name: Run tests
on:
pull_request:
branches: ["*"]
push:
branches: ["main"]
env:
CARGO_TERM_COLOR: always
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install latest stable compiler
id: toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: clippy
- name: Cache multiple paths
id: cache
uses: actions/cache@v2
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-${{ steps.toolchain.outputs.rustc_hash }}-${{ hashFiles('**/*.lock') }}
- name: Clean cache if it's too big
run: |
du -hs target || exit 0
target_size=$(du -ms target | awk '{print $1}')
if [ "$target_size" -gt "5120" ]; then
echo "size is ${target_size}, running cargo clean"
cargo clean
fi
- name: Lint code
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features
- name: Check format
run: cargo fmt -- --check
- name: Run tests
run: cargo test
- name: Verify example-protocol can be compiled
run: |
pushd examples/example-protocol
cargo run
popd
- name: Install Wasm target
run: |
rustup target add wasm32-unknown-unknown wasm32-wasi
- name: Verify example-plugin builds
run: |
pushd examples/example-plugin
cargo build
popd
- name: Install Deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- name: Run end-to-end tests in Deno runtime
run: |
pushd examples/example-deno-runtime
deno test --allow-read tests.ts
popd
- name: Run end-to-end tests in Wasmer 2 runtime
run: |
pushd examples/example-rust-wasmer2-runtime
cargo test
cargo test -F wasi
popd