Skip to content

Commit

Permalink
feat: check bytecode size in gh actions (#259)
Browse files Browse the repository at this point in the history
* feat: check bytecode size in gh actions

* address comment
  • Loading branch information
milapsheth authored Nov 22, 2023
1 parent cc12201 commit d453659
Show file tree
Hide file tree
Showing 4 changed files with 156 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ jobs:
run: npm ci

- name: Test
run: npm run test-evm-versions
run: CHECK_CONTRACT_SIZE=true npm run test-evm-versions
11 changes: 10 additions & 1 deletion hardhat.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
require('@nomicfoundation/hardhat-toolbox');
require('solidity-coverage');
const { importNetworks, readJSON } = require('@axelar-network/axelar-chains-config');

if (process.env.STORAGE_LAYOUT) {
require('hardhat-storage-layout');
}

if (process.env.CHECK_CONTRACT_SIZE) {
require('hardhat-contract-sizer');
}

const { importNetworks, readJSON } = require('@axelar-network/axelar-chains-config');

const env = process.env.ENV || 'testnet';
const chains = require(`@axelar-network/axelar-chains-config/info/${env}.json`);
const keys = readJSON(`${__dirname}/keys.json`);
Expand Down Expand Up @@ -47,4 +52,8 @@ module.exports = {
gasReporter: {
enabled: process.env.REPORT_GAS !== undefined,
},
contractSizer: {
runOnCompile: process.env.CHECK_CONTRACT_SIZE,
strict: process.env.CHECK_CONTRACT_SIZE,
},
};
147 changes: 143 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@
"eslint-config-richardpringle": "^2.0.0",
"ethers": "^5.7.2",
"fs-extra": "^11.1.1",
"hardhat": "^2.17.2",
"hardhat": "^2.19.1",
"hardhat-storage-layout": "^0.1.7",
"hardhat-contract-sizer": "^2.10.0",
"lodash": "^4.17.21",
"mocha": "^10.2.0",
"prettier": "^2.8.7",
Expand Down

0 comments on commit d453659

Please sign in to comment.