chore: configured gas-reporter and codechecks CI

This commit is contained in:
gitpusha 2020-11-10 19:23:22 +01:00 committed by Twin Fish
parent fd9eedf224
commit 2944a4e56e
5 changed files with 551 additions and 31 deletions

View File

@ -20,20 +20,23 @@ jobs: # a collection of steps
- ./node_modules - ./node_modules
- run: # Compile - run: # Compile
name: Compile name: Compile
command: npx hardhat compile command: yarn compile
- run: # Formatting - run: # Formatting
name: Prettier Check name: Prettier Check
command: yarn prettier --check . command: yarn prettier --check .
- run: # Linting - run: # Linting
name: ESLint name: ESLint
command: yarn eslint . && yarn lint:sol command: yarn lint
- restore_cache: # special step to restore the Hardhat Network Fork Cache - restore_cache: # special step to restore the Hardhat Network Fork Cache
# Read about caching dependencies: https://circleci.com/docs/2.0/caching/ # Read about caching dependencies: https://circleci.com/docs/2.0/caching/
name: Restore Hardhat Network Fork Cache name: Restore Hardhat Network Fork Cache
key: hardhat-network-fork key: hardhat-network-fork
- run: # Tests - run: # Tests
name: Tests using hardhat mainnet fork name: Tests using hardhat mainnet fork and gas reporter
command: npx hardhat test command: REPORT_GAS=1 yarn test
- run: # Codechecks
name: Codechecks gas reporting
command: npx codechecks
- save_cache: # special step to save the Hardhat Network Fork cache - save_cache: # special step to save the Hardhat Network Fork cache
name: Save Hardhat Network Fork Cache name: Save Hardhat Network Fork Cache
key: hardhat-network-fork key: hardhat-network-fork

5
codechecks.yml Normal file
View File

@ -0,0 +1,5 @@
checks:
- name: eth-gas-reporter/codechecks
settings:
branches:
- master

View File

@ -4,6 +4,7 @@ require("@nomiclabs/hardhat-ethers");
require("@nomiclabs/hardhat-waffle"); require("@nomiclabs/hardhat-waffle");
require("hardhat-deploy"); require("hardhat-deploy");
require("hardhat-deploy-ethers"); require("hardhat-deploy-ethers");
require("hardhat-gas-reporter");
// Libraries // Libraries
const assert = require("assert"); const assert = require("assert");
@ -26,6 +27,11 @@ const INSTA_MASTER = "0xb1DC62EC38E6E3857a887210C38418E4A17Da5B2";
// ================================= CONFIG ========================================= // ================================= CONFIG =========================================
module.exports = { module.exports = {
defaultNetwork: "hardhat", defaultNetwork: "hardhat",
gasReporter: {
enabled: process.env.REPORT_GAS ? true : false,
maxMethodDiff: 25,
coinmarketcap: process.env.COINMARKETCAP_API_KEY,
},
// hardhat-deploy // hardhat-deploy
namedAccounts: { namedAccounts: {
deployer: { deployer: {

View File

@ -16,6 +16,7 @@
"debug": "DEBUG=true yarn compile && npx hardhat test" "debug": "DEBUG=true yarn compile && npx hardhat test"
}, },
"devDependencies": { "devDependencies": {
"@codechecks/client": "^0.1.10",
"@gelatonetwork/core": "1.0.0", "@gelatonetwork/core": "1.0.0",
"@nomiclabs/hardhat-ethers": "2.0.0", "@nomiclabs/hardhat-ethers": "2.0.0",
"@nomiclabs/hardhat-waffle": "2.0.0", "@nomiclabs/hardhat-waffle": "2.0.0",
@ -28,6 +29,7 @@
"hardhat": "2.0.2", "hardhat": "2.0.2",
"hardhat-deploy": "0.7.0-beta.28", "hardhat-deploy": "0.7.0-beta.28",
"hardhat-deploy-ethers": "^0.3.0-beta.5", "hardhat-deploy-ethers": "^0.3.0-beta.5",
"hardhat-gas-reporter": "^1.0.1",
"husky": ">=4", "husky": ">=4",
"lint-staged": "10.5.1", "lint-staged": "10.5.1",
"prettier": "2.1.2", "prettier": "2.1.2",

558
yarn.lock

File diff suppressed because it is too large Load Diff