-
Notifications
You must be signed in to change notification settings - Fork 25
159 lines (130 loc) · 6.33 KB
/
fuzz.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
157
158
159
name: Test Fuzz Tests
on:
workflow_dispatch:
pull_request: # Workflow can be triggered by either a manual dispatch or a pull request
env:
HONGGFUZZ_VERSION: 0.5.56 # Honggfuzz version to install in the environment
AFL_VERSION: 0.15.10 # AFL version to install in the environment
jobs:
Fuzz-Tests:
name: Fuzz Tests
runs-on: ubuntu-20.04
steps:
- run: echo "Starting Fuzz Tests"
simple-cpi-6:
name: Fuzz Tests (simple-cpi-6)
needs: Fuzz-Tests
# Runs on an Ubuntu 20.04 runner
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
name: Checkout Repository # Checkout the repository to get access to the project files
# https://github.com/Swatinem/rust-cache
- name: Cache Rust and its Packages
# Caches Rust dependencies to avoid redundant downloads and speed up builds
uses: Swatinem/rust-cache@v2
with:
prefix-key: "fuzz"
shared-key: "trident-rust-cache" # Using a shared cache key for multiple jobs
- name: Setup Rust Environment
# Sets up the Rust environment (e.g., installing Rust and required components)
uses: ./.github/actions/setup-rust/
- name: Install Trident
# Sets up the Trident
uses: ./.github/actions/setup-trident/
- name: Setup AFL
# Sets up AFL, a fuzzing tool that will be used by Trident
uses: ./.github/actions/setup-afl/
- name: Setup Honggfuzz
# Sets up Honggfuzz, a fuzzing tool that will be used by Trident
uses: ./.github/actions/setup-honggfuzz/
# Cache the target folder, which stores the build artifacts generated by the fuzzing process
- name: Cache Target Folder
uses: actions/cache@v3
with:
path: examples/fuzz-tests/simple-cpi-6/trident-tests/fuzz_tests/fuzzing/honggfuzz/hfuzz_target # Cache the folder where build artifacts are stored
key: target-${{ runner.os }}-simple-cpi-6 # Unique key for caching based on OS and test
# Run the fuzzing test using Trident in the simple-cpi-6 directory
- name: Test Fuzz
working-directory: examples/fuzz-tests/simple-cpi-6 # Set the working directory for the fuzzing test
run: trident fuzz run-hfuzz fuzz_0 # Run the fuzz test with trident
arbitrary-limit-inputs-5:
name: Fuzz Tests (arbitrary-limit-inputs-5)
needs: Fuzz-Tests
# Runs on an Ubuntu 20.04 runner for a different fuzz test
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
name: Checkout Repository # Checkout the repository
# https://github.com/Swatinem/rust-cache
- name: Cache Rust and its Packages
# Caches Rust dependencies to avoid redundant downloads and speed up builds
uses: Swatinem/rust-cache@v2
with:
prefix-key: "fuzz" # Using a locally shared cache key
shared-key: "trident-rust-cache" # Using a shared cache key for multiple jobs
- name: Setup Rust Environment
# Sets up the Rust environment (e.g., installing Rust and required components)
uses: ./.github/actions/setup-rust/
- name: Install Trident
# Sets up the Trident
uses: ./.github/actions/setup-trident/
- name: Setup AFL
# Sets up AFL, a fuzzing tool that will be used by Trident
uses: ./.github/actions/setup-afl/
- name: Setup Honggfuzz
# Sets up Honggfuzz, a fuzzing tool that will be used by Trident
uses: ./.github/actions/setup-honggfuzz/
# Cache the target folder, which stores the build artifacts generated by the fuzzing process
- name: Cache Target Folder
uses: actions/cache@v3
with:
path: examples/fuzz-tests/arbitrary-limit-inputs-5/trident-tests/fuzz_tests/fuzzing/honggfuzz/hfuzz_target # Cache the folder where build artifacts are stored
key: target-${{ runner.os }}-arbitrary-limit-inputs-5 # Unique key for caching based on OS and test
# Run the fuzzing test using Trident in the arbitrary-limit-inputs-5 directory
- name: Test Fuzz
working-directory: examples/fuzz-tests/arbitrary-limit-inputs-5 # Set the working directory for the fuzzing test
run: trident fuzz run-hfuzz fuzz_0 # Run the fuzz test with trident
cpi-metaplex-7:
name: Fuzz Tests (cpi-metaplex-7)
needs: Fuzz-Tests
# Runs on an Ubuntu 20.04 runner for a different fuzz test
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
name: Checkout Repository # Checkout the repository
# https://github.com/Swatinem/rust-cache
- name: Cache Rust and its Packages
# Caches Rust dependencies to avoid redundant downloads and speed up builds
uses: Swatinem/rust-cache@v2
with:
prefix-key: "fuzz" # Using a locally shared cache key
shared-key: "trident-rust-cache" # Using a shared cache key for multiple jobs
- name: Setup Rust Environment
# Sets up the Rust environment (e.g., installing Rust and required components)
uses: ./.github/actions/setup-rust/
- name: Install Trident
# Sets up the Trident
uses: ./.github/actions/setup-trident/
- name: Setup AFL
# Sets up AFL, a fuzzing tool that will be used by Trident
uses: ./.github/actions/setup-afl/
- name: Setup Honggfuzz
# Sets up Honggfuzz, a fuzzing tool that will be used by Trident
uses: ./.github/actions/setup-honggfuzz/
# Cache the target folder, which stores the build artifacts generated by the fuzzing process
- name: Cache Target Folder
uses: actions/cache@v3
with:
path: examples/fuzz-tests/cpi-metaplex-7/trident-tests/fuzz_tests/fuzzing/honggfuzz/hfuzz_target # Cache the folder where build artifacts are stored
key: target-${{ runner.os }}-cpi-metaplex-7 # Unique key for caching based on OS and test
# Run the fuzzing test using Trident in the cpi-metaplex-7 directory
- name: Test Fuzz
working-directory: examples/fuzz-tests/cpi-metaplex-7 # Set the working directory for the fuzzing test
run: trident fuzz run-hfuzz fuzz_0 # Run the fuzz test with trident
checks:
name: Fuzz Tests (Checks)
needs: [simple-cpi-6, arbitrary-limit-inputs-5,cpi-metaplex-7]
runs-on: ubuntu-20.04
steps:
- run: echo "All fuzz tests completed successfully"