-
Notifications
You must be signed in to change notification settings - Fork 0
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 #22 from VaporFi/ci-workflow
feat: add CI, prettier and reduce anti-whale
- Loading branch information
Showing
69 changed files
with
3,315 additions
and
3,359 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 |
---|---|---|
@@ -0,0 +1,98 @@ | ||
name: "CI" | ||
|
||
env: | ||
API_KEY_ALCHEMY: ${{ secrets.API_KEY_ALCHEMY }} | ||
FOUNDRY_PROFILE: "ci" | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
push: | ||
branches: | ||
- "main" | ||
|
||
jobs: | ||
lint: | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- name: "Check out the repo" | ||
uses: "actions/checkout@v4" | ||
|
||
- name: "Install Foundry" | ||
uses: "foundry-rs/foundry-toolchain@v1" | ||
|
||
- name: "Install pnpm" | ||
uses: pnpm/action-setup@v3 | ||
with: | ||
version: 8 | ||
|
||
- name: "Install the Node.js dependencies" | ||
run: "pnpm install" | ||
|
||
- name: "Lint the code" | ||
run: "pnpm run lint" | ||
|
||
- name: "Add lint summary" | ||
run: | | ||
echo "## Lint result" >> $GITHUB_STEP_SUMMARY | ||
echo "✅ Passed" >> $GITHUB_STEP_SUMMARY | ||
build: | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- name: "Check out the repo" | ||
uses: "actions/checkout@v4" | ||
|
||
- name: "Install Foundry" | ||
uses: "foundry-rs/foundry-toolchain@v1" | ||
|
||
- name: "Install pnpm" | ||
uses: pnpm/action-setup@v3 | ||
with: | ||
version: 8 | ||
|
||
- name: "Install the Node.js dependencies" | ||
run: "pnpm install" | ||
|
||
- name: "Build the contracts and print their size" | ||
run: "forge build --sizes" | ||
|
||
- name: "Add build summary" | ||
run: | | ||
echo "## Build result" >> $GITHUB_STEP_SUMMARY | ||
echo "✅ Passed" >> $GITHUB_STEP_SUMMARY | ||
test: | ||
needs: ["lint", "build"] | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- name: "Check out the repo" | ||
uses: "actions/checkout@v4" | ||
|
||
- name: "Install Foundry" | ||
uses: "foundry-rs/foundry-toolchain@v1" | ||
|
||
- name: "Install pnpm" | ||
uses: pnpm/action-setup@v3 | ||
with: | ||
version: 8 | ||
|
||
- name: "Install the Node.js dependencies" | ||
run: "pnpm install" | ||
|
||
- name: "Show the Foundry config" | ||
run: "forge config" | ||
|
||
- name: "Generate a fuzz seed that changes weekly to avoid burning through RPC allowance" | ||
run: > | ||
echo "FOUNDRY_FUZZ_SEED=$( | ||
echo $(($EPOCHSECONDS - $EPOCHSECONDS % 604800)) | ||
)" >> $GITHUB_ENV | ||
- name: "Run the tests" | ||
run: "forge test" | ||
|
||
- name: "Add test summary" | ||
run: | | ||
echo "## Tests result" >> $GITHUB_STEP_SUMMARY | ||
echo "✅ Passed" >> $GITHUB_STEP_SUMMARY |
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 @@ | ||
pnpm lint |
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,20 @@ | ||
# directories | ||
broadcast | ||
cache | ||
cache_forge | ||
coverage | ||
node_modules | ||
out | ||
artifacts | ||
typechain-types | ||
|
||
# files | ||
*.env | ||
*.log | ||
.DS_Store | ||
.pnp.* | ||
bun.lockb | ||
lcov.info | ||
package-lock.json | ||
pnpm-lock.yaml | ||
yarn.lock |
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,21 @@ | ||
{ | ||
"plugins": ["prettier-plugin-solidity"], | ||
"printWidth": 80, | ||
"tabWidth": 2, | ||
"useTabs": false, | ||
"semi": true, | ||
"singleQuote": false, | ||
"trailingComma": "all", | ||
"bracketSpacing": true, | ||
"bracketSameLine": false, | ||
"arrowParens": "always", | ||
"endOfLine": "lf", | ||
"overrides": [ | ||
{ | ||
"files": ["*.sol"], | ||
"options": { | ||
"printWidth": 120 | ||
} | ||
} | ||
] | ||
} |
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,14 @@ | ||
{ | ||
"extends": "solhint:recommended", | ||
"rules": { | ||
"code-complexity": ["error", 8], | ||
"compiler-version": ["error", ">=0.8.25"], | ||
"func-name-mixedcase": "off", | ||
"func-visibility": ["error", { "ignoreConstructors": true }], | ||
"max-line-length": ["error", 120], | ||
"named-parameters-mapping": "warn", | ||
"no-console": "off", | ||
"not-rely-on-time": "off", | ||
"one-contract-per-file": "off" | ||
} | ||
} |
Oops, something went wrong.