From cbf4b7d45e86c618fb6dd6846208f4cd34a2ebe4 Mon Sep 17 00:00:00 2001 From: Ben DiFrancesco Date: Tue, 4 Mar 2025 08:57:20 -0500 Subject: [PATCH 1/2] Set up a separate profile for running coverage on CI The CI job on coverage should only run unit tests, not invariant tests, and it does not need many fuzz runs of these tests just to ensure the code is coverged. --- .github/workflows/ci.yml | 2 ++ foundry.toml | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7dde004..7a4e927 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,6 +37,8 @@ jobs: coverage: runs-on: ubuntu-latest + env: + FOUNDRY_PROFILE: coverage steps: - uses: actions/checkout@v3 diff --git a/foundry.toml b/foundry.toml index 47001ef..86e5158 100644 --- a/foundry.toml +++ b/foundry.toml @@ -9,6 +9,10 @@ fuzz = { runs = 5000 } invariant = { runs = 1000 } +[profile.coverage] + fuzz = { runs = 100 } + invariant = { runs = 0 } + [profile.lite] fuzz = { runs = 50 } invariant = { runs = 10 } From 5c7279cd6d233a5aaef2793e31f625ca8d57ec4c Mon Sep 17 00:00:00 2001 From: Ben DiFrancesco Date: Tue, 4 Mar 2025 09:01:07 -0500 Subject: [PATCH 2/2] Bump to solc v0.8.28 and forge-std v1.9.6 --- foundry.toml | 2 +- lib/forge-std | 2 +- script/Deploy.s.sol | 2 +- src/Counter.sol | 2 +- test/Counter.t.sol | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/foundry.toml b/foundry.toml index 86e5158..8fe91aa 100644 --- a/foundry.toml +++ b/foundry.toml @@ -2,7 +2,7 @@ evm_version = "paris" optimizer = true optimizer_runs = 10_000_000 - solc_version = "0.8.26" + solc_version = "0.8.28" verbosity = 3 [profile.ci] diff --git a/lib/forge-std b/lib/forge-std index 978ac6f..3b20d60 160000 --- a/lib/forge-std +++ b/lib/forge-std @@ -1 +1 @@ -Subproject commit 978ac6fadb62f5f0b723c996f64be52eddba6801 +Subproject commit 3b20d60d14b343ee4f908cb8079495c07f5e8981 diff --git a/script/Deploy.s.sol b/script/Deploy.s.sol index 7e21573..6cb780f 100644 --- a/script/Deploy.s.sol +++ b/script/Deploy.s.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: UNLICENSED // slither-disable-start reentrancy-benign -pragma solidity 0.8.26; +pragma solidity 0.8.28; import {Script} from "forge-std/Script.sol"; import {Counter} from "src/Counter.sol"; diff --git a/src/Counter.sol b/src/Counter.sol index b7f6120..bc89d21 100644 --- a/src/Counter.sol +++ b/src/Counter.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.26; +pragma solidity 0.8.28; contract Counter { uint256 public number; diff --git a/test/Counter.t.sol b/test/Counter.t.sol index 054a199..d458d80 100644 --- a/test/Counter.t.sol +++ b/test/Counter.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.26; +pragma solidity 0.8.28; import {Test, console2} from "forge-std/Test.sol"; import {Deploy} from "script/Deploy.s.sol";