Skip to content

Require initial deposit to be larger than 1e5 units #215

Require initial deposit to be larger than 1e5 units

Require initial deposit to be larger than 1e5 units #215

name: Report gas diff
env:
RPC_URL_MAINNET: ${{ secrets.RPC_URL_MAINNET }}
RPC_URL_GOERLI: ${{ secrets.RPC_URL_GOERLI }}
RPC_URL_OPTIMISM: ${{ secrets.RPC_URL_OPTIMISM }}
RPC_URL_ARBITRUM: ${{ secrets.RPC_URL_ARBITRUM }}
on:
push:
branches:
- master
pull_request:
# Optionally configure to run only for changes in specific files. For example:
# paths:
# - src/**
# - test/**
# - foundry.toml
# - remappings.txt
# - .github/workflows/foundry-gas-diff.yml
jobs:
compare-gas-reports:
runs-on: ubuntu-latest
defaults:
run:
working-directory: 'core'
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Run tests
run: forge test --gas-report --match-contract ".*Gas" > ../gasreport.ansi # <- this file name should be unique in your repository!
env:
# make fuzzing semi-deterministic to avoid noisy gas cost estimation
# due to non-deterministic fuzzing (but still use pseudo-random fuzzing seeds)
FOUNDRY_FUZZ_SEED: 0x${{ github.event.pull_request.base.sha || github.sha }}
- name: Compare gas reports
uses: Rubilmax/[email protected]
with:
summaryQuantile: 0.9 # only display the 10% most significant gas diffs in the summary (defaults to 20%)
sortCriteria: avg,max # sort diff rows by criteria
sortOrders: desc,asc # and directions
ignore: test-foundry/**/* # filter out gas reports from specific paths (test/ is included by default)
match: src/VolatilityOracle.sol,src/RateModel.sol,src/Lender.sol,src/Factory.sol,src/Borrower.sol
id: gas_diff
- name: Add gas diff to sticky comment
if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target'
uses: marocchino/sticky-pull-request-comment@v2
with:
# delete the comment in case changes no longer impact gas costs
delete: ${{ !steps.gas_diff.outputs.markdown }}
message: ${{ steps.gas_diff.outputs.markdown }}