Skip to content

Commit 7167d1f

Browse files
authored
✨0.8.0 (#213)
✨0.8.0
2 parents 63403d4 + 72f4ab1 commit 7167d1f

File tree

289 files changed

+30529
-40561
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

289 files changed

+30529
-40561
lines changed

.github/actions/setup-afl/action.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: "Setup AFL"
2+
3+
runs:
4+
using: "composite"
5+
steps:
6+
# Install AFL using Cargo
7+
- name: Install AFL
8+
run: cargo install cargo-afl --version ${{ env.AFL_VERSION }} # Install the specified version of AFL via Cargo
9+
shell: bash

.github/actions/setup-anchor/action.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,16 @@
11
name: "Setup Honggfuzz"
2-
description: "Setup Honggfuzz"
32

43
runs:
54
using: "composite"
65
steps:
7-
- uses: actions/cache@v3
8-
name: Cache Honggfuzz
9-
id: cache-honggfuzz
10-
with:
11-
path: |
12-
~/.cache/honggfuzz/
13-
~/.local/share/honggfuzz/
14-
key: honggfuzz-${{ runner.os }}-v0000-${{ env.HONGGFUZZ_VERSION }}
15-
- name: Install honggfuzz
16-
run: cargo install honggfuzz --version ${{ env.HONGGFUZZ_VERSION }}
6+
# Install system dependencies required by Honggfuzz
7+
- name: Install Dependencies (binutils-dev & libunwind-dev)
8+
run: |
9+
sudo apt-get update # Update the system package lists
10+
sudo apt-get install -y binutils-dev libunwind-dev # Install binutils-dev and libunwind-dev, which are required for fuzzing
1711
shell: bash
18-
- name: Install binutils-dev
19-
run: sudo apt-get install binutils-dev
20-
shell: bash
21-
- name: Install libunwind-dev
22-
run: sudo apt-get install libunwind-dev
12+
13+
# Install Honggfuzz using Cargo
14+
- name: Install Honggfuzz
15+
run: cargo install honggfuzz --version ${{ env.HONGGFUZZ_VERSION }} # Install the specified version of Honggfuzz via Cargo
2316
shell: bash

.github/actions/setup-rust/action.yml

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,23 @@
11
name: "Setup Rust"
2-
description: "Setup Rust"
3-
4-
outputs:
5-
rustc-hash:
6-
description: "Hash of the rustc version"
7-
value: ${{ steps.rust-version.outputs.RUSTC_HASH }}
82

93
runs:
104
using: "composite"
115
steps:
6+
# Install essential system packages required for building Rust projects
127
- name: Install system packages
13-
run: sudo apt-fast update && sudo apt-fast install -y build-essential libudev-dev
8+
run: sudo apt-get update && sudo apt-get install -y build-essential libudev-dev # Installs essential packages like GCC and libudev development headers
149
shell: bash
15-
- name: Install Rust nightly
10+
11+
# Install Rust nightly toolchain and additional components
12+
# Ensure rustfmt and clippy are installed for the nightly toolchain as well
13+
- name: Install Rust Toolchain Components
1614
run: |
17-
rustup default nightly
15+
rustup install nightly
1816
rustup component add rustfmt clippy
17+
rustup component add rustfmt clippy --toolchain nightly
1918
shell: bash
19+
20+
# Install Cargo Expand for expanding macros in Rust, useful for debugging macro-generated code
2021
- name: Install Cargo Expand
21-
run: cargo install --locked cargo-expand
22-
shell: bash
23-
- name: Get rustc version
24-
id: rust-version
25-
run: echo "::set-output name=RUSTC_HASH::$(rustc -V | cut -d " " -f 3 | tail -c +2)"
22+
run: cargo install --locked cargo-expand # Installs the cargo-expand tool, using --locked to ensure exact versions from Cargo.lock are used
2623
shell: bash

.github/actions/setup-solana/action.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.
Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
11
name: "Setup Trident"
2-
description: "Setup Trident"
32

43
runs:
4+
# This setup does not use caching, so it always installs Trident fresh
55
using: "composite"
66
steps:
7-
- uses: actions/cache@v3
8-
name: Cache Trident
9-
id: cache-trident
10-
with:
11-
path: |
12-
~/.cache/trident/
13-
~/.local/share/trident/
14-
key: trident-${{ runner.os }}-v0000
7+
# Install Trident from the local crates/cli directory
158
- name: Install Trident
169
run: cargo install --path crates/cli
1710
shell: bash

.github/workflows/build-documentation.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ on:
55
push:
66
branches:
77
- develop
8-
- master
98

109
jobs:
1110
build:

.github/workflows/fuzz.yml

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
name: Test Fuzz Tests
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request: # Workflow can be triggered by either a manual dispatch or a pull request
6+
7+
env:
8+
HONGGFUZZ_VERSION: 0.5.56 # Honggfuzz version to install in the environment
9+
AFL_VERSION: 0.15.10 # AFL version to install in the environment
10+
11+
12+
jobs:
13+
Fuzz-Tests:
14+
name: Fuzz Tests
15+
runs-on: ubuntu-20.04
16+
steps:
17+
- run: echo "Starting Fuzz Tests"
18+
19+
simple-cpi-6:
20+
name: Fuzz Tests (simple-cpi-6)
21+
needs: Fuzz-Tests
22+
# Runs on an Ubuntu 20.04 runner
23+
runs-on: ubuntu-20.04
24+
steps:
25+
- uses: actions/checkout@v3
26+
name: Checkout Repository # Checkout the repository to get access to the project files
27+
28+
# https://github.com/Swatinem/rust-cache
29+
- name: Cache Rust and its Packages
30+
# Caches Rust dependencies to avoid redundant downloads and speed up builds
31+
uses: Swatinem/rust-cache@v2
32+
with:
33+
prefix-key: "fuzz"
34+
shared-key: "trident-rust-cache" # Using a shared cache key for multiple jobs
35+
36+
- name: Setup Rust Environment
37+
# Sets up the Rust environment (e.g., installing Rust and required components)
38+
uses: ./.github/actions/setup-rust/
39+
40+
- name: Install Trident
41+
# Sets up the Trident
42+
uses: ./.github/actions/setup-trident/
43+
44+
- name: Setup AFL
45+
# Sets up AFL, a fuzzing tool that will be used by Trident
46+
uses: ./.github/actions/setup-afl/
47+
48+
- name: Setup Honggfuzz
49+
# Sets up Honggfuzz, a fuzzing tool that will be used by Trident
50+
uses: ./.github/actions/setup-honggfuzz/
51+
52+
# Cache the target folder, which stores the build artifacts generated by the fuzzing process
53+
- name: Cache Target Folder
54+
uses: actions/cache@v3
55+
with:
56+
path: examples/fuzz-tests/simple-cpi-6/trident-tests/fuzz_tests/fuzzing/honggfuzz/hfuzz_target # Cache the folder where build artifacts are stored
57+
key: target-${{ runner.os }}-simple-cpi-6 # Unique key for caching based on OS and test
58+
59+
# Run the fuzzing test using Trident in the simple-cpi-6 directory
60+
- name: Test Fuzz
61+
working-directory: examples/fuzz-tests/simple-cpi-6 # Set the working directory for the fuzzing test
62+
run: trident fuzz run-hfuzz fuzz_0 # Run the fuzz test with trident
63+
64+
arbitrary-limit-inputs-5:
65+
name: Fuzz Tests (arbitrary-limit-inputs-5)
66+
needs: Fuzz-Tests
67+
# Runs on an Ubuntu 20.04 runner for a different fuzz test
68+
runs-on: ubuntu-20.04
69+
steps:
70+
- uses: actions/checkout@v3
71+
name: Checkout Repository # Checkout the repository
72+
73+
# https://github.com/Swatinem/rust-cache
74+
- name: Cache Rust and its Packages
75+
# Caches Rust dependencies to avoid redundant downloads and speed up builds
76+
uses: Swatinem/rust-cache@v2
77+
with:
78+
prefix-key: "fuzz" # Using a locally shared cache key
79+
shared-key: "trident-rust-cache" # Using a shared cache key for multiple jobs
80+
81+
- name: Setup Rust Environment
82+
# Sets up the Rust environment (e.g., installing Rust and required components)
83+
uses: ./.github/actions/setup-rust/
84+
85+
- name: Install Trident
86+
# Sets up the Trident
87+
uses: ./.github/actions/setup-trident/
88+
89+
- name: Setup AFL
90+
# Sets up AFL, a fuzzing tool that will be used by Trident
91+
uses: ./.github/actions/setup-afl/
92+
93+
- name: Setup Honggfuzz
94+
# Sets up Honggfuzz, a fuzzing tool that will be used by Trident
95+
uses: ./.github/actions/setup-honggfuzz/
96+
97+
# Cache the target folder, which stores the build artifacts generated by the fuzzing process
98+
- name: Cache Target Folder
99+
uses: actions/cache@v3
100+
with:
101+
path: examples/fuzz-tests/arbitrary-limit-inputs-5/trident-tests/fuzz_tests/fuzzing/honggfuzz/hfuzz_target # Cache the folder where build artifacts are stored
102+
key: target-${{ runner.os }}-arbitrary-limit-inputs-5 # Unique key for caching based on OS and test
103+
104+
# Run the fuzzing test using Trident in the arbitrary-limit-inputs-5 directory
105+
- name: Test Fuzz
106+
working-directory: examples/fuzz-tests/arbitrary-limit-inputs-5 # Set the working directory for the fuzzing test
107+
run: trident fuzz run-hfuzz fuzz_0 # Run the fuzz test with trident
108+
109+
cpi-metaplex-7:
110+
name: Fuzz Tests (cpi-metaplex-7)
111+
needs: Fuzz-Tests
112+
# Runs on an Ubuntu 20.04 runner for a different fuzz test
113+
runs-on: ubuntu-20.04
114+
steps:
115+
- uses: actions/checkout@v3
116+
name: Checkout Repository # Checkout the repository
117+
118+
# https://github.com/Swatinem/rust-cache
119+
- name: Cache Rust and its Packages
120+
# Caches Rust dependencies to avoid redundant downloads and speed up builds
121+
uses: Swatinem/rust-cache@v2
122+
with:
123+
prefix-key: "fuzz" # Using a locally shared cache key
124+
shared-key: "trident-rust-cache" # Using a shared cache key for multiple jobs
125+
126+
- name: Setup Rust Environment
127+
# Sets up the Rust environment (e.g., installing Rust and required components)
128+
uses: ./.github/actions/setup-rust/
129+
130+
- name: Install Trident
131+
# Sets up the Trident
132+
uses: ./.github/actions/setup-trident/
133+
134+
- name: Setup AFL
135+
# Sets up AFL, a fuzzing tool that will be used by Trident
136+
uses: ./.github/actions/setup-afl/
137+
138+
- name: Setup Honggfuzz
139+
# Sets up Honggfuzz, a fuzzing tool that will be used by Trident
140+
uses: ./.github/actions/setup-honggfuzz/
141+
142+
# Cache the target folder, which stores the build artifacts generated by the fuzzing process
143+
- name: Cache Target Folder
144+
uses: actions/cache@v3
145+
with:
146+
path: examples/fuzz-tests/cpi-metaplex-7/trident-tests/fuzz_tests/fuzzing/honggfuzz/hfuzz_target # Cache the folder where build artifacts are stored
147+
key: target-${{ runner.os }}-cpi-metaplex-7 # Unique key for caching based on OS and test
148+
149+
# Run the fuzzing test using Trident in the cpi-metaplex-7 directory
150+
- name: Test Fuzz
151+
working-directory: examples/fuzz-tests/cpi-metaplex-7 # Set the working directory for the fuzzing test
152+
run: trident fuzz run-hfuzz fuzz_0 # Run the fuzz test with trident
153+
154+
checks:
155+
name: Fuzz Tests (Checks)
156+
needs: [simple-cpi-6, arbitrary-limit-inputs-5,cpi-metaplex-7]
157+
runs-on: ubuntu-20.04
158+
steps:
159+
- run: echo "All fuzz tests completed successfully"

0 commit comments

Comments
 (0)