Skip to content

feat: manage list of addresses allowed to call drip #245

feat: manage list of addresses allowed to call drip

feat: manage list of addresses allowed to call drip #245

name: Solidity Lint, and Coverage
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Install pnpm
run: npm install -g pnpm
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: "18"
- name: Install Dependencies
run: pnpm install
- name: Run Solidity Linter
run: pnpm exec solhint 'src/**/*.sol'
coverage:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Install forge-coverage
run: forge install
# Add build step before coverage
- name: Build contracts
run: |
forge build --extra-output-files abi --extra-output-files storageLayout
- name: Run Coverage
run: forge coverage --skip "*FFI.t.sol" --report lcov
# Check fails if coverage percentage falls under 80%
- name: Check Coverage Threshold
run: |
COVERAGE=$(forge coverage --skip "*FFI.t.sol"--report summary | grep 'Total coverage:' | awk '{print $3}' | cut -d'%' -f1)
echo "Coverage is $COVERAGE%"
if [ "$COVERAGE" -lt 80 ]; then
echo "Code coverage ($COVERAGE%) is below the threshold (80%)"
exit 1
fi