Skip to content

Commit

Permalink
Updated foundry.toml and ci.yml for fuzz seeding approach
Browse files Browse the repository at this point in the history
  • Loading branch information
jferas committed Nov 27, 2023
1 parent 510bc4d commit 95a8d93
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
17 changes: 17 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,20 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 5
submodules: "recursive"

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

# https://twitter.com/PaulRBerg/status/1611116650664796166
- name: Generate fuzz seed with 1 week TTL
run: >
echo "FOUNDRY_FUZZ_SEED=$(
echo $(($EPOCHSECONDS - $EPOCHSECONDS % 604800))
)" >> $GITHUB_ENV
- name: Run tests
run: forge test

Expand All @@ -46,6 +56,13 @@ jobs:
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

# https://twitter.com/PaulRBerg/status/1611116650664796166
- name: Recycle the fuzz seed from the test run
run: >
echo "FOUNDRY_FUZZ_SEED=$(
echo $(($EPOCHSECONDS - $EPOCHSECONDS % 604800))
)" >> $GITHUB_ENV
- name: Run coverage
run: forge coverage --report summary --report lcov

Expand Down
3 changes: 2 additions & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[profile.default]
evm_version = "paris"
fuzz = { seed = "1" }
optimizer = true
optimizer_runs = 10_000_000
remappings = [
Expand All @@ -10,7 +11,7 @@
verbosity = 3

[profile.ci]
fuzz = { runs = 50 }
fuzz = { runs = 256 }
invariant = { runs = 1000 }

[profile.lite]
Expand Down

0 comments on commit 95a8d93

Please sign in to comment.