-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from 0xPolygon/dev/foundry
Merge Foundry migration to main
- Loading branch information
Showing
99 changed files
with
17,640 additions
and
31,481 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,42 +4,84 @@ on: | |
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
branches: [main, dev/foundry] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
tests: | ||
forge-tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
with: | ||
version: nightly | ||
- name: Build | ||
run: forge build | ||
- name: Run tests | ||
run: forge test -vvv | ||
hardhat-tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
- name: Get node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "18.x" | ||
cache: "npm" | ||
- run: npm ci | ||
- run: npx hardhat compile --show-stack-traces | ||
- run: npx hardhat test --parallel | ||
lint: | ||
node-version: "16.x" | ||
cache: "yarn" | ||
- name: Setup | ||
run: yarn | ||
- name: Build | ||
run: yarn build | ||
- name: Run tests | ||
run: yarn test | ||
coverage: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
with: | ||
version: nightly | ||
- name: Build | ||
run: forge build | ||
- name: Get node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "18.x" | ||
cache: "npm" | ||
- run: npm ci | ||
- run: npx solhint "contracts/**/*.sol" | ||
- run: npx prettier -c . | ||
slither: | ||
node-version: "16.x" | ||
cache: "yarn" | ||
- name: Setup | ||
run: yarn && sudo apt-get install lcov | ||
- name: Get coverage | ||
run: yarn coverage | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Get node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "18.x" | ||
cache: "npm" | ||
- run: rm foundry.toml # force hardhat https://github.com/foundry-rs/foundry/issues/3827 | ||
- uses: crytic/[email protected] | ||
cache: "yarn" | ||
- run: yarn | ||
- run: yarn lint | ||
slither: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
with: | ||
version: nightly | ||
- name: Build | ||
run: forge build | ||
- name: Slither | ||
uses: crytic/[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[submodule "lib/forge-std"] | ||
path = lib/forge-std | ||
url = https://github.com/foundry-rs/forge-std | ||
[submodule "lib/openzeppelin-contracts"] | ||
path = lib/openzeppelin-contracts | ||
url = https://github.com/openzeppelin/openzeppelin-contracts | ||
branch = v4.8.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,25 @@ | ||
{ | ||
"extends": "solhint:recommended", | ||
"rules": { | ||
"compiler-version": ["error", "^0.8.0"], | ||
"func-visibility": ["warn", { "ignoreConstructors": true }] | ||
"compiler-version": [ | ||
"error", | ||
"^0.8.0" | ||
], | ||
"func-visibility": [ | ||
"warn", | ||
{ | ||
"ignoreConstructors": true | ||
} | ||
], | ||
"no-console": "off", | ||
"no-global-import": "off", | ||
"reason-string": [ | ||
"warn", | ||
{ | ||
"maxLength": 64 | ||
} | ||
], | ||
"func-name-mixedcase": "off", | ||
"no-inline-assembly": "off" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
node_modules | ||
lib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.