diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml new file mode 100644 index 000000000..d95310dc7 --- /dev/null +++ b/.github/workflows/node.js.yml @@ -0,0 +1,25 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: Node.js CI + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [10.x, 12.x, 14.x] + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + - run: npm i + - run: npm run test-js diff --git a/.prettierignore b/.prettierignore index ce98afc62..e0bde8783 100644 --- a/.prettierignore +++ b/.prettierignore @@ -2,6 +2,7 @@ __pycache__ .DS_Store .history .hypothesis/ +artifacts/ build/ reports/ node_modules/ diff --git a/.travis.yml b/.travis.yml index 2f8434a81..3f2421062 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,15 +9,15 @@ cache: - node_modules before_install: - - export NODE_OPTIONS=--max_old_space_size=4096 + - export NODE_OPTIONS=--max_old_space_size=6144 install: - npm install script: - npm run lint-contracts - - npm run test-js + - npm run prettier-check + - npm run coverage after_script: - - npm run coverage - cat coverage/lcov.info | coveralls \ No newline at end of file diff --git a/contracts/governance/Staking/WeightedStaking.sol b/contracts/governance/Staking/WeightedStaking.sol index 82b7226e3..a9210af3a 100644 --- a/contracts/governance/Staking/WeightedStaking.sol +++ b/contracts/governance/Staking/WeightedStaking.sol @@ -319,5 +319,4 @@ contract WeightedStaking is Checkpoints { } return date; } - } diff --git a/package.json b/package.json index f36ce51da..b2b720e97 100644 --- a/package.json +++ b/package.json @@ -49,8 +49,13 @@ }, "scripts": { "analyze-contracts": "slither .", - "prettier": "prettier --write {,*/**/}*.{js,test.js,sol}", - "lint-contracts": "solhint contracts/**/*.sol", + "prettier": "npm run prettier-sol && npm run prettier-js", + "prettier-sol": "prettier --write contracts/{**/*,**/**/*,**/**/**/*}.sol", + "prettier-js": "prettier --write tests-js/{*,**/*,**/**/*}.{js,test.js}", + "prettier-check": "npm run prettier-check-sol && npm run prettier-check-js", + "prettier-check-sol": "prettier --check contracts/{**/*,**/**/*,**/**/**/*}.sol", + "prettier-check-js": "prettier --check tests-js/{*,**/*,**/**/*}.{js,test.js}", + "lint-contracts": "solhint contracts/{**/*,**/**/*,**/**/**/*}.sol", "test": "brownie test", "test-js": "echo Executing pure Hardhat test cases ... && npx hardhat test && echo Executing test cases using Ganache ... && npx hardhat --config hardhat-ganache-tests.config.js --network ganache test", "coverage": "npx hardhat coverage",