-
Notifications
You must be signed in to change notification settings - Fork 5
156 lines (129 loc) · 4.76 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
name: test
on: [push]
defaults:
run:
shell: bash
jobs:
format-check:
name: format-check
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: cargo fmt --check
run: cargo fmt --check
build-and-test:
name: build-and-test
runs-on: ubuntu-latest
env:
TEST_DATA_SSH_KEY: ${{ secrets.TEST_DATA_SSH_KEY }}
steps:
- name: checkout
uses: actions/checkout@v3
- name: checkout test-data submodule
continue-on-error: true
if: ${{ env.TEST_DATA_SSH_KEY != '' }}
env:
SSH_KEY: ${{ env.TEST_DATA_SSH_KEY }}
run: |
eval `ssh-agent`
ssh-add - <<< "${SSH_KEY}"
git submodule update --init --checkout test-data
- name: cache cargo output
uses: actions/cache@v3
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
- name: cargo check
run: cargo check --verbose
- name: cargo build
run: cargo build --verbose
- name: install libav libraries for ffmpeg tests
run: sudo apt-get install --no-install-recommends -y libavcodec-dev libavformat-dev libavutil-dev libswresample-dev libswscale-dev
- name: install gpac libraries for gpac tests
run: |
wget https://download.tsi.telecom-paristech.fr/gpac/release/2.2/gpac_2.2-rev0-gab012bbf-master_amd64.deb
sudo apt-get install ./gpac_2.2-rev0-gab012bbf-master_amd64.deb
wget https://download.tsi.telecom-paristech.fr/gpac/release/2.2/libgpac-dev_2.2-rev0-gab012bbf-master_amd64.deb
sudo apt-get install ./libgpac-dev_2.2-rev0-gab012bbf-master_amd64.deb
- name: cargo test -- --skip test_data
run: cargo test --verbose --features mp4san-test/ffmpeg,mp4san-test/gpac,webpsan-test/libwebp -- --skip test_data
- name: cargo test test_data
continue-on-error: true
if: ${{ env.TEST_DATA_SSH_KEY != '' }}
run: cargo test --verbose --features mp4san-test/ffmpeg,mp4san-test/gpac,webpsan-test/libwebp test_data -- --show-output
- name: cargo clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ github.token }}
fuzz-afl:
name: fuzz-afl
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: cache cargo output
uses: actions/cache@v3
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-afl-${{ hashFiles('Cargo.lock') }}
- name: cargo install cargo-afl
run: cargo install cargo-afl --verbose
- name: fuzz mp4san for 10 seconds
run: cd mp4san/fuzz-afl && AFL_I_DONT_CARE_ABOUT_MISSING_CRASHES=1 ./fuzz -V 10
- name: fuzz webpsan for 10 seconds
run: cd webpsan/fuzz-afl && AFL_I_DONT_CARE_ABOUT_MISSING_CRASHES=1 ./fuzz -V 10
fuzz-libfuzzer:
name: fuzz-libfuzzer
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: install latest rust nightly toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
- name: cache cargo output
uses: actions/cache@v3
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-libfuzzer-${{ hashFiles('Cargo.lock') }}
- name: cargo install cargo-fuzz
run: cargo install cargo-fuzz --verbose
- name: fuzz mp4san for 10 seconds
run: cd mp4san && cargo +nightly fuzz run sanitize -- -seed_inputs=$(find fuzz/input/ -type f | tr '\n' ,) -dict=fuzz/mp4.dict -max_total_time=10
- name: fuzz webpsan for 10 seconds
run: cd webpsan && cargo +nightly fuzz run sanitize -- -seed_inputs=$(find fuzz/input/ -type f | tr '\n' ,) -dict=fuzz/webp.dict -max_total_time=10
build-nightly:
name: check-nightly
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: install latest rust nightly toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
- name: cache cargo output
uses: actions/cache@v3
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-nightly-${{ hashFiles('Cargo.lock') }}
- name: cargo +nightly check
run: cargo +nightly check --verbose