Skip to content

Commit

Permalink
Add slither-mutate support in GH actions
Browse files Browse the repository at this point in the history
  • Loading branch information
matjazv committed Jun 3, 2024
1 parent f8622d6 commit d895a46
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/slither-mutate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Slither Mutate Analysis

#on: workflow_dispatch
on:
pull_request:
branches: [ main ]

env:
FOUNDRY_PROFILE: ci

jobs:
check:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Install Slither
run: |
pip install slither-analyzer
- name: Run Slither-Mutate
run: |
slither-mutate . --test-cmd='forge test' --test-dir='test' --ignore-dirs='script,lib,test,utils,deployment'
id: slither-mutate
20 changes: 20 additions & 0 deletions test/scripts/runSlitherMutate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash

echo "Instructing the shell to exit immediately if any command returns a non-zero exit status..."
set -e
echo "Done."

echo "Navigating to the root directory of the project..."
cd ../../
echo "Done."

echo "Removing directory mutation_campaign if it exists..."
if [ -d "mutation_campaign" ]
then
rm -rf mutation_campaign
fi
echo "Done."

echo "Starting Slither Mutate Campaign..."
slither-mutate . --test-cmd='forge test' --test-dir='test' --ignore-dirs='script,lib,test,utils,cache,out,broadcast,deployment'
echo "Done."

0 comments on commit d895a46

Please sign in to comment.