Skip to content

Commit

Permalink
💚 Pipeline Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
lukacan committed Oct 2, 2024
1 parent 6e030ab commit e7f5153
Show file tree
Hide file tree
Showing 19 changed files with 346 additions and 396 deletions.
15 changes: 15 additions & 0 deletions .github/actions/setup-honggfuzz/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: "Setup Honggfuzz"
description: "Setup Honggfuzz"

runs:
using: "composite"
steps:
- name: Install Dependencies (binutils-dev & libunwind-dev)
run: |
sudo apt-get update
sudo apt-get install -y binutils-dev libunwind-dev
shell: bash

- name: Install Honggfuzz
run: cargo install honggfuzz --version ${{ env.HONGGFUZZ_VERSION }}
shell: bash
16 changes: 11 additions & 5 deletions .github/actions/setup-rust/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@ outputs:
runs:
using: "composite"
steps:
# Cache Rust toolchain and Cargo artifacts
- uses: actions/cache@v3
name: Cache Rust Toolchain and Cargo Artifacts
with:
path: |
~/.cargo/registry
~/.cargo/git
~/.cargo/bin
~/.rustup
key: rust-toolchain-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}

- name: Install system packages
run: sudo apt-get update && sudo apt-get install -y build-essential libudev-dev
shell: bash
Expand All @@ -22,8 +33,3 @@ runs:
- name: Install Cargo Expand
run: cargo install --locked cargo-expand
shell: bash

- name: Get rustc version
id: rust-version
run: echo "rustc_hash=$(rustc -V | cut -d ' ' -f 3)" >> $GITHUB_ENV
shell: bash
31 changes: 0 additions & 31 deletions .github/actions/setup-solana/action.yaml

This file was deleted.

26 changes: 9 additions & 17 deletions .github/actions/setup-trident/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,14 @@ description: "Setup Trident"
runs:
using: "composite"
steps:
- uses: actions/cache@v3
name: Cache Trident
id: cache-trident
with:
path: |
~/.cache/trident/
~/.local/share/trident/
key: trident-${{ runner.os }}-v0000-${{ env.TRIDENT_COMMIT_HASH }}

- name: Clone Trident at specified commit
- name: Clone Trident at specified commit and Install
run: |
git clone https://github.com/Ackee-Blockchain/trident.git
cd trident
git checkout ${{ env.TRIDENT_COMMIT_HASH }}
shell: bash

- name: Install Trident
run: cargo install --path crates/cli
if ! command -v trident &> /dev/null; then
git clone --depth 1 https://github.com/Ackee-Blockchain/trident.git
cd trident
git checkout ${{ env.TRIDENT_COMMIT_HASH }}
cargo install --path crates/cli
else
echo "Trident is already installed, skipping installation."
fi
shell: bash
23 changes: 10 additions & 13 deletions .github/workflows/run-fuzz-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,34 @@ on:
pull_request:

env:
SOLANA_CLI_VERSION: 1.18.18
HONGGFUZZ_VERSION: 0.5.56
TRIDENT_COMMIT_HASH: eb8f647104209323b53e3637d3d3c5b7d140d368 # Set desired commit hash here
TRIDENT_COMMIT_HASH: eb8f647104209323b53e3637d3d3c5b7d140d368 # Desired Trident commit hash

jobs:
simple-cpi-6:
fuzz_0:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
name: Checkout Repository

- name: Set Anchor Version
run: echo "ANCHOR_VERSION=0.30.1" >> $GITHUB_ENV

- uses: Swatinem/rust-cache@v2
name: Cache Rust and its Packages

- name: Setup Rust Environment
uses: ./.github/actions/setup-rust/

- name: Setup Solana Environment
uses: ./.github/actions/setup-solana/

- name: Setup Trident with Specified Commit
uses: ./.github/actions/setup-trident/
with:
commit-hash: ${{ env.TRIDENT_COMMIT_HASH }}

- name: Setup Honggfuzz
uses: ./.github/actions/setup-honggfuzz/
id: rust-setup

# Cache the target folder, which stores build artifacts for the current workspace
- name: Cache Target Folder
uses: actions/cache@v3
with:
path: trident-tests/fuzz_tests/fuzzing/hfuzz_target # default folder to store build artifacts
key: target-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}-${{ env.TRIDENT_COMMIT_HASH }}

- name: Run Fuzz Tests
run: trident fuzz run fuzz_0
run: trident fuzz run --with-exit-code fuzz_0
Loading

0 comments on commit e7f5153

Please sign in to comment.