Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add aderyn to github actions #210

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/actions/aderyn/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
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
TanvirDeol marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was because of the rust-cache, which is unnecessary so I removed it. I initially added it thinking it would speed things up.

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 -q "warning:" aderyn_output.log || grep -q "Found issues" aderyn_output.log; then
echo "Aderyn analysis found warnings."
exit 1
fi
shell: bash
19 changes: 19 additions & 0 deletions .github/workflows/aderyn.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Aderyn Static Analysis

on:
pull_request:
branches:
- ci/aderyn-analysis
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: remove

- main

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

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

steps:
TanvirDeol marked this conversation as resolved.
Show resolved Hide resolved
- name: Run Aderyn Static Analysis
uses: axelarnetwork/axelar-gmp-sdk-solidity/.github/actions/aderyn@ci/aderyn-analysis
Loading