Skip to content

Commit

Permalink
chore(contracts-rfq): gas bench script (#3283)
Browse files Browse the repository at this point in the history
* chore: add gas:bench script

* ci: use the defined script
  • Loading branch information
ChiTimesChi authored Oct 14, 2024
1 parent bc21cfa commit de92c1f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/solidity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,9 @@ jobs:
- name: Run tests and generate gas report
working-directory: './packages/${{matrix.package}}'
# Run separate set of tests (no fuzzing) to get accurate average gas cost estimates
run: forge test --mc GasBenchmark --gas-report > "../../gas-report-${{ matrix.package }}.ansi"
# Note: we use `npm run` with `--if-present` flag, allows not to define a gas:bench script in every package
# This is not natively supported by yarn yet, see: https://github.com/yarnpkg/yarn/pull/7159
run: npm run gas:bench --if-present > "../../gas-report-${{ matrix.package }}.ansi"

- name: Compare gas reports
uses: Rubilmax/[email protected]
Expand Down
1 change: 1 addition & 0 deletions packages/contracts-rfq/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"build:slither": "forge build --out=out --build-info --force",
"test:coverage": "echo 'Please use foundry'",
"test": "forge test",
"gas:bench": "forge test --mc GasBenchmark --gas-report",
"lint": "forge fmt && npm run solhint",
"lint:check": "forge fmt --check && npm run solhint:check",
"ci:lint": "npm run lint:check",
Expand Down

0 comments on commit de92c1f

Please sign in to comment.