Skip to content

Commit

Permalink
ci: add aderyn to github actions (#210)
Browse files Browse the repository at this point in the history
  • Loading branch information
TanvirDeol authored Feb 24, 2025
1 parent aab7a4e commit 9a03aba
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/actions/aderyn/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: "Aderyn Static Analysis"
description: "Run Aderyn static analysis and upload the report as an artifact"

inputs:
rust_toolchain:
description: "Rust toolchain version"
required: true
default: "stable"

runs:
using: "composite"
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ inputs.rust_toolchain }}

- name: Install Aderyn
run: cargo install --git https://github.com/Cyfrin/aderyn.git
shell: bash

- name: Generate Aderyn Report
id: run_aderyn
run: |
aderyn --output report.md . 2>&1 | tee aderyn_output.log
shell: bash

- name: Print Aderyn Warnings to Console
run: cat report.md
shell: bash

- name: Upload Aderyn Report as Artifact
uses: actions/upload-artifact@v4
with:
name: aderyn-report
path: report.md

- name: Check Aderyn Report for Warnings
run: |
if grep -E "warning:|Found issues" aderyn_output.log; then
echo "Aderyn analysis found warnings."
exit 1
else
echo "No warnings or issues found by Aderyn."
fi
shell: bash
18 changes: 18 additions & 0 deletions .github/workflows/aderyn.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Aderyn Static Analysis

on:
pull_request:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
aderyn:
runs-on: blacksmith-2vcpu-ubuntu-2204

steps:
- name: Run Aderyn Static Analysis
uses: axelarnetwork/axelar-gmp-sdk-solidity/.github/actions/aderyn@main

0 comments on commit 9a03aba

Please sign in to comment.