Skip to content

feat(TBAEF-1634): Add signature discount validator #345

feat(TBAEF-1634): Add signature discount validator

feat(TBAEF-1634): Add signature discount validator #345

Workflow file for this run

name: test
on:
pull_request:
branches:
- main
env:
FOUNDRY_PROFILE: ci
BASE_SEPOLIA_RPC_URL: "https://sepolia.base.org"
BASE_MAINNET_RPC_URL: "https://mainnet.base.org"
jobs:
forge-test:
name: Run Forge Tests and Checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.8'
- name: Install eth-abi
run: |
python3 -m pip install --upgrade pip
python3 -m pip install eth-abi
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: stable
- name: Run Forge build
run: |
forge --version
id: build
- name: Run Forge tests
run: |
forge test -vvv --ffi
id: test
- name: Get changed Solidity files
id: changed-files
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
BASE_COMMIT=${{ github.event.pull_request.base.sha }}
HEAD_COMMIT=${{ github.event.pull_request.head.sha }}
CHANGED_FILES=$(git diff --name-only --diff-filter=ACMR $BASE_COMMIT..$HEAD_COMMIT | grep '\.sol$' || true)
else
CHANGED_FILES=$(git diff --name-only --diff-filter=ACMR HEAD^..HEAD | grep '\.sol$' || true)
fi
echo "files=$CHANGED_FILES" >> $GITHUB_OUTPUT
echo "Changed Solidity files: $CHANGED_FILES"
- name: Check formatting on changed files
if: steps.changed-files.outputs.files != ''
run: |
# Convert the file list to an array and pass each file individually
FILES="${{ steps.changed-files.outputs.files }}"
if [ -n "$FILES" ]; then
echo "Checking formatting for files: $FILES"
echo "$FILES" | while IFS= read -r file; do
if [ -n "$file" ]; then
echo "Checking: $file"
forge fmt --check "$file"
fi
done
fi
id: fmt