-
Notifications
You must be signed in to change notification settings - Fork 66
99 lines (93 loc) · 3.18 KB
/
main.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
name: CI
on: [push, pull_request]
jobs:
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
rust: [stable, beta, nightly]
steps:
- uses: actions/checkout@v1
with:
submodules: true
- name: Install Rust
run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
# Build an up-to-date version of wabt since the releases don't always have
# all the features we want.
- uses: actions/checkout@v2
with:
repository: WebAssembly/wabt
ref: aa0515b3c808da880942db8658abeaa969534667
path: wabt
- name: Build wabt
run: |
set -e
cd wabt
cmake . -DBUILD_TESTS=OFF
make -j$(nproc) wast2json spectest-interp wasm-interp
echo `pwd` > $GITHUB_PATH
- name: Install binaryen
run: |
set -e
curl -L https://github.com/WebAssembly/binaryen/releases/download/1.39.1/binaryen-1.39.1-x86_64-linux.tar.gz | tar xzf -
echo "`pwd`/binaryen-1.39.1" > $GITHUB_PATH
- run: cargo build --all
- run: cargo test --all
- run: cargo check --benches
- run: cargo test --features parallel
- run: cargo test --features parallel --manifest-path crates/tests/Cargo.toml
fuzz_crate:
name: Fuzz Crate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Install Rust
run: rustup update stable && rustup default stable
- name: Install wabt
run: |
set -e
curl -L https://github.com/WebAssembly/wabt/releases/download/1.0.13/wabt-1.0.13-linux.tar.gz | tar xzf -
echo "`pwd`/wabt-1.0.13" > $GITHUB_PATH
- name: Install binaryen
run: |
set -e
curl -L https://github.com/WebAssembly/binaryen/releases/download/1.39.1/binaryen-1.39.1-x86_64-linux.tar.gz | tar xzf -
echo "`pwd`/binaryen-1.39.1" > $GITHUB_PATH
- name: Run fuzzer
run: cargo test -p walrus-fuzz-utils > fuzz.log || (tail -n 1000 fuzz.log && exit 1)
env:
# 300 seconds = 5 minutes.
WALRUS_FUZZ_TIMEOUT: 300
fuzz:
name: Fuzz
runs-on: ubuntu-latest
strategy:
matrix:
test: [watgen, wasm-opt-ttf, raw]
steps:
- uses: actions/checkout@master
- name: Install Rust
run: rustup update nightly && rustup default nightly
- run: cargo install cargo-fuzz
- name: Install wabt
run: |
set -e
curl -L https://github.com/WebAssembly/wabt/releases/download/1.0.13/wabt-1.0.13-linux.tar.gz | tar xzf -
echo "`pwd`/wabt-1.0.13" > $GITHUB_PATH
- name: Install binaryen
run: |
set -e
curl -L https://github.com/WebAssembly/binaryen/releases/download/1.39.1/binaryen-1.39.1-x86_64-linux.tar.gz | tar xzf -
echo "`pwd`/binaryen-1.39.1" > $GITHUB_PATH
- name: Run fuzzer
run: |
cargo fuzz run ${{ matrix.test }} -- -max_total_time=300 -rss_limit_mb=4096 > fuzz.log 2>&1 || (tail -n 1000 fuzz.log && exit 1)
rustfmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Install Rust
run: rustup update stable && rustup default stable && rustup component add rustfmt
- run: cargo fmt -- --check