Skip to content

Commit 0896e72

Browse files
author
lukacan
committed
πŸ› Initial commit fuzz tests
πŸ”₯ Ackee fuzz tests
1 parent c10a6a8 commit 0896e72

File tree

87 files changed

+33731
-265
lines changed

Some content is hidden

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

87 files changed

+33731
-265
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: "Install Solana"
2+
description: "Installs Solana CLI tools at a specified version"
3+
inputs:
4+
solana-version:
5+
description: "Solana version to install (e.g., v2.2.16)"
6+
required: true
7+
8+
runs:
9+
using: "composite"
10+
steps:
11+
- name: Cache Solana CLI
12+
id: cache-solana
13+
uses: actions/cache@v4
14+
with:
15+
path: ~/.local/share/solana/install
16+
key: solana-${{ inputs.solana-version }}-${{ runner.os }}
17+
18+
- name: Install Solana CLI
19+
if: steps.cache-solana.outputs.cache-hit != 'true'
20+
shell: bash
21+
run: |
22+
sh -c "$(curl -sSfL https://release.anza.xyz/${{ inputs.solana-version }}/install)"
23+
24+
- name: Add Solana to PATH
25+
shell: bash
26+
run: |
27+
echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
28+
29+
- name: Verify Solana Installation
30+
shell: bash
31+
run: |
32+
export PATH="$HOME/.local/share/solana/install/active_release/bin:$PATH"
33+
solana --version
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: Trident Fuzz Tests
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches:
7+
- develop
8+
- master
9+
10+
env:
11+
CARGO_TERM_COLOR: always
12+
SOLANA_VERSION: "v3.1.9"
13+
TRIDENT_VERSION: "0.13.0-rc.2"
14+
15+
jobs:
16+
build:
17+
name: Build Programs
18+
runs-on: ubuntu-24.04
19+
steps:
20+
- uses: actions/checkout@v4
21+
name: Checkout Repository
22+
23+
- name: Install system packages
24+
run: sudo apt-get update && sudo apt-get install -y build-essential libudev-dev protobuf-compiler libprotobuf-dev
25+
shell: bash
26+
27+
- name: Install Solana
28+
uses: ./.github/actions/solana/install-solana
29+
with:
30+
solana-version: ${{ env.SOLANA_VERSION }}
31+
32+
- name: Rust Cache
33+
uses: Swatinem/rust-cache@v2
34+
with:
35+
cache-on-failure: true
36+
shared-key: "trident-build"
37+
38+
- name: Build All Programs
39+
run: make build-all
40+
41+
- name: Upload Program Artifacts
42+
uses: actions/upload-artifact@v4
43+
with:
44+
name: program-binaries
45+
path: target/deploy/*.so
46+
retention-days: 1
47+
48+
fuzz-tests:
49+
name: Fuzz - ${{ matrix.test.name }}
50+
needs: build
51+
runs-on: ubuntu-24.04
52+
strategy:
53+
fail-fast: false
54+
matrix:
55+
test:
56+
- name: "fuzz_0"
57+
target: "fuzz_0"
58+
- name: "fuzz_1"
59+
target: "fuzz_1"
60+
- name: "fuzz_2"
61+
target: "fuzz_2"
62+
- name: "fuzz_3"
63+
target: "fuzz_3"
64+
- name: "fuzz_launchpad"
65+
target: "fuzz_launchpad"
66+
- name: "fuzz_pbpp"
67+
target: "fuzz_pbpp"
68+
69+
steps:
70+
- uses: actions/checkout@v4
71+
name: Checkout Repository
72+
73+
- name: Install system packages
74+
run: sudo apt-get update && sudo apt-get install -y build-essential libudev-dev protobuf-compiler libprotobuf-dev
75+
shell: bash
76+
77+
- name: Download Program Artifacts
78+
uses: actions/download-artifact@v4
79+
with:
80+
name: program-binaries
81+
path: target/deploy
82+
83+
- name: Rust Cache
84+
uses: Swatinem/rust-cache@v2
85+
with:
86+
cache-on-failure: true
87+
shared-key: "trident-fuzz-${{ matrix.test.target }}"
88+
workspaces: |
89+
./trident-tests
90+
91+
- name: Install Trident
92+
run: cargo install trident-cli --version ${{ env.TRIDENT_VERSION }}
93+
94+
- name: Run Fuzz Test
95+
working-directory: trident-tests
96+
run: trident fuzz run ${{ matrix.test.target }} -e invariants
97+
98+
checks:
99+
name: Fuzz Tests (Checks)
100+
needs: fuzz-tests
101+
runs-on: ubuntu-24.04
102+
steps:
103+
- run: echo "All fuzz tests completed successfully"

0 commit comments

Comments
Β (0)