Skip to content

Merge pull request #103 from tokamak-network/OR-1447-change-package-name #29

Merge pull request #103 from tokamak-network/OR-1447-change-package-name

Merge pull request #103 from tokamak-network/OR-1447-change-package-name #29

Workflow file for this run

name: slither analysis
on:
push:
paths:
- 'packages/tokamak/contracts-bedrock/**'
jobs:
analyze:
runs-on: ubuntu-latest
steps:
# Checkout the repository
- name: Checkout repository
uses: actions/checkout@v3
# Add the repository to safe directories
- name: Add repo to git safe directories
run: git config --global --add safe.directory $GITHUB_WORKSPACE
# Setup Node.js environment
- name: Set up Node
uses: actions/setup-node@v4
# Restore pnpm package cache
- name: Restore PNPM Package Cache
uses: actions/cache@v3
with:
path: ~/.pnpm-store
key: pnpm-packages-v3-${{ hashFiles('pnpm-lock.yaml') }}
# Copy necessary tools from Docker container
- name: Copy foundry from Docker container
run: |
container_id=$(docker create onthertech/titan-ci-builder:latest)
mkdir -p $HOME/bin
docker cp $container_id:/usr/local/bin/cast $HOME/bin/
docker cp $container_id:/usr/local/bin/anvil $HOME/bin/
docker cp $container_id:/usr/local/bin/forge $HOME/bin/
docker rm $container_id
# Set permissions for the copied tools and add them to the PATH
- name: Set permissions and add PATH
run: |
chmod +x $HOME/bin/*
echo "$HOME/bin" >> $GITHUB_PATH
# Install pnpm and dependencies
- name: Install pnpm and dependencies
run: |
npm install --global pnpm
pnpm install
# Save pnpm package cache for future runs
- name: Save PNPM Package Cache
uses: actions/cache@v3
with:
path: ~/.pnpm-store
# Ensure cache key consistency
key: pnpm-packages-v3-${{ hashFiles('pnpm-lock.yaml') }}
# Build smart contracts
- name: Build the contracts
run: |
cd packages/tokamak/contracts-bedrock
forge build --build-info --skip '*/test/**' '*/scripts/**'
# Analyze smart contracts with Slither
- name: Run Slither
uses: crytic/[email protected]
with:
target: packages/tokamak/contracts-bedrock
slither-config: packages/tokamak/contracts-bedrock/slither.config.json
fail-on: config
slither-version: dev-triage-db
slither-args: --triage-database packages/tokamak/contracts-bedrock/slither.db.json
ignore-compile: true