Skip to content

Commit 23395e9

Browse files
Tasks: Add gas cost reports to CI (#117)
Co-authored-by: Facu Spagnuolo <facundo_spagnuolo@icloud.com>
1 parent 6c59d57 commit 23395e9

File tree

6 files changed

+442
-19
lines changed

6 files changed

+442
-19
lines changed

.github/workflows/ci-tasks.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,8 @@ jobs:
3434
- name: Build
3535
run: yarn build
3636
- name: Test
37-
run: yarn workspace @mimic-fi/v3-tasks test
37+
run: REPORT_GAS=true yarn workspace @mimic-fi/v3-tasks test
38+
- name: Gas Report
39+
env:
40+
CC_SECRET: ${{ secrets.CODECHECKS_SECRET }}
41+
run: yarn workspace @mimic-fi/v3-tasks codechecks

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ build
55
dist
66
.certora_internal
77
.certora_recent_jobs.json
8+
gasReporterOutput.json
89
*.log

packages/tasks/codechecks.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
name: Codechecks
2+
description: Run codechecks for gas reports
3+
4+
checks:
5+
- name: eth-gas-reporter/codechecks

packages/tasks/hardhat.config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import '@nomiclabs/hardhat-ethers'
22
import '@nomiclabs/hardhat-waffle'
33
import '@mimic-fi/v3-helpers/dist/tests'
44
import 'hardhat-local-networks-config-plugin'
5+
import 'hardhat-gas-reporter'
56

67
import { homedir } from 'os'
78
import path from 'path'
@@ -17,4 +18,10 @@ export default {
1718
},
1819
},
1920
},
21+
gasReporter: {
22+
outputFile: 'gasReporterOutput.json',
23+
enabled: !!process.env.REPORT_GAS,
24+
noColors: true,
25+
excludeContracts: ['Mock'],
26+
},
2027
}

packages/tasks/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"@quant-finance/solidity-datetime": "2.2.0"
3232
},
3333
"devDependencies": {
34+
"@codechecks/client": "^0.1.12",
3435
"@nomiclabs/hardhat-ethers": "^2.2.3",
3536
"@nomiclabs/hardhat-waffle": "2.0.3",
3637
"@types/chai": "^4.3.5",
@@ -41,6 +42,7 @@
4142
"ethereum-waffle": "^3.4.4",
4243
"ethers": "~5.6.0",
4344
"hardhat": "^2.14.1",
45+
"hardhat-gas-reporter": "^1.0.9",
4446
"hardhat-local-networks-config-plugin": "^0.0.6",
4547
"mocha": "^10.2.0",
4648
"solhint-config-mimic": "^0.0.3",

0 commit comments

Comments
 (0)