-
Notifications
You must be signed in to change notification settings - Fork 74
ci: tone down fuzzing #474
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,176 @@ | ||
| name: "CI Deep" | ||
|
|
||
| env: | ||
| API_KEY_ETHERSCAN: ${{ secrets.API_KEY_ETHERSCAN }} | ||
| API_KEY_INFURA: ${{ secrets.API_KEY_INFURA }} | ||
| RPC_URL_MAINNET: ${{ secrets.RPC_URL_MAINNET }} | ||
|
|
||
| on: | ||
| schedule: | ||
| - cron: "0 3 * * 1" # at 3:00am UTC every Monday | ||
| workflow_dispatch: | ||
| inputs: | ||
| forkRuns: | ||
| default: "100000" | ||
| description: 'Number of fork test runs. Defaults to 1000' | ||
| required: false | ||
| fuzzRuns: | ||
| default: "100000" | ||
| description: 'Number of fuzz test runs. Defaults to 100,000' | ||
| required: false | ||
| invariantDepth: | ||
| default: "100" | ||
| description: 'Number of function calls made in a given run. Defaults to 100' | ||
| required: false | ||
| invariantRuns: | ||
| default: "100" | ||
| description: 'Number of sequences of function calls generated and run. Defaults to 100' | ||
| required: false | ||
|
|
||
| jobs: | ||
| lint: | ||
| runs-on: "ubuntu-latest" | ||
| steps: | ||
| - name: "Check out the repo" | ||
| uses: "actions/checkout@v3" | ||
|
|
||
| - name: "Install Foundry" | ||
| uses: "foundry-rs/foundry-toolchain@v1" | ||
|
|
||
| - name: "Install Pnpm" | ||
| uses: "pnpm/action-setup@v2" | ||
| with: | ||
| version: "8" | ||
|
|
||
| - name: "Install Node.js" | ||
| uses: "actions/setup-node@v3" | ||
| with: | ||
| cache: "pnpm" | ||
| node-version: "lts/*" | ||
|
|
||
| - name: "Install the Node.js dependencies" | ||
| run: "pnpm install" | ||
|
|
||
| - name: "Lint the contracts" | ||
| run: "pnpm 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@v3" | ||
| with: | ||
| submodules: "recursive" | ||
|
|
||
| - name: "Install Foundry" | ||
| uses: "foundry-rs/foundry-toolchain@v1" | ||
|
|
||
| - name: "Show the Foundry config" | ||
| run: "forge config" | ||
|
|
||
| - name: "Produce an optimized build with --via-ir" | ||
| run: "FOUNDRY_PROFILE=optimized forge build" | ||
|
|
||
| - name: "Cache the build so that it can be re-used by the other jobs" | ||
| uses: "actions/cache/save@v3" | ||
| with: | ||
| path: "optimized-out" | ||
| key: "foundry-build-${{ github.sha }}" | ||
|
|
||
| - name: "Add build summary" | ||
| run: | | ||
| echo "## Build result" >> $GITHUB_STEP_SUMMARY | ||
| echo "✅ Passed" >> $GITHUB_STEP_SUMMARY | ||
|
|
||
| test-fuzz: | ||
| env: | ||
| FOUNDRY_FUZZ_RUNS: ${{ inputs.fuzzRuns || "100000" }} | ||
| needs: ["lint", "build"] | ||
| runs-on: "ubuntu-latest" | ||
| steps: | ||
| - name: "Check out the repo" | ||
| uses: "actions/checkout@v3" | ||
| with: | ||
| submodules: "recursive" | ||
|
|
||
| - name: "Install Foundry" | ||
| uses: "foundry-rs/foundry-toolchain@v1" | ||
|
|
||
| - name: "Restore the cached build" | ||
| uses: "actions/cache/restore@v3" | ||
| with: | ||
| fail-on-cache-miss: true | ||
| key: "foundry-build-${{ github.sha }}" | ||
| path: "optimized-out" | ||
|
|
||
| - name: "Run the fuzz tests against the optimized build" | ||
| run: "FOUNDRY_PROFILE=test-optimized forge test --match-path \"test/fuzz/**/*.sol\"" | ||
|
|
||
| - name: "Add test summary" | ||
| run: | | ||
| echo "## Fuzz tests result" >> $GITHUB_STEP_SUMMARY | ||
| echo "✅ Passed" >> $GITHUB_STEP_SUMMARY | ||
|
|
||
| test-invariant: | ||
| env: | ||
| FOUNDRY_INVARIANT_DEPTH: ${{ inputs.invariantDepth || "100" }} | ||
| FOUNDRY_INVARIANT_RUNS: ${{ inputs.invariantRuns || "100" }} | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't need the
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We do need the |
||
| needs: ["lint", "build"] | ||
| runs-on: "ubuntu-latest" | ||
| steps: | ||
| - name: "Check out the repo" | ||
| uses: "actions/checkout@v3" | ||
| with: | ||
| submodules: "recursive" | ||
|
|
||
| - name: "Install Foundry" | ||
| uses: "foundry-rs/foundry-toolchain@v1" | ||
|
|
||
| - name: "Restore the cached build" | ||
| uses: "actions/cache/restore@v3" | ||
| with: | ||
| fail-on-cache-miss: true | ||
| key: "foundry-build-${{ github.sha }}" | ||
| path: "optimized-out" | ||
|
|
||
| - name: "Run the invariant tests against the optimized build" | ||
| run: "FOUNDRY_PROFILE=test-optimized forge test --match-path \"test/invariant/**/*.sol\"" | ||
|
|
||
| - name: "Add test summary" | ||
| run: | | ||
| echo "## Invariant tests result" >> $GITHUB_STEP_SUMMARY | ||
| echo "✅ Passed" >> $GITHUB_STEP_SUMMARY | ||
|
|
||
| test-fork: | ||
| env: | ||
| FOUNDRY_FUZZ_RUNS: ${{ inputs.forkRuns || "1000" }} | ||
PaulRBerg marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| needs: ["lint", "build"] | ||
| runs-on: "ubuntu-latest" | ||
| steps: | ||
| - name: "Check out the repo" | ||
| uses: "actions/checkout@v3" | ||
| with: | ||
| submodules: "recursive" | ||
|
|
||
| - name: "Install Foundry" | ||
| uses: "foundry-rs/foundry-toolchain@v1" | ||
|
|
||
| - name: "Restore the cached build" | ||
| uses: "actions/cache/restore@v3" | ||
| with: | ||
| fail-on-cache-miss: true | ||
| key: "foundry-build-${{ github.sha }}" | ||
| path: "optimized-out" | ||
|
|
||
| - name: "Run the fork tests against the optimized build" | ||
| run: "FOUNDRY_PROFILE=test-optimized forge test --match-path \"test/fork/**/*.sol\"" | ||
|
|
||
| - name: "Add test summary" | ||
| run: | | ||
| echo "## Fork tests result" >> $GITHUB_STEP_SUMMARY | ||
| echo "✅ Passed" >> $GITHUB_STEP_SUMMARY | ||
Uh oh!
There was an error while loading. Please reload this page.