Add CI: build, test, fmt, coverage#30
Merged
Merged
Conversation
Runs on every push to main and every PR: - forge build --sizes (compilation + contract size report) - forge test -v (full test suite with fuzz) - forge fmt --check (formatting gate) - forge coverage --report lcov + Codecov upload (informational, not a gate) Codecov upload requires CODECOV_TOKEN secret to be set in repo settings.
forge build --sizes exits non-zero when any contract exceeds EIP-170. MockTokenFactory is a test mock that intentionally exceeds the limit. Separate compilation (forge build) from the informational size report so test mocks do not block CI.
Nightly foundry has different fmt rules than stable. Pinning to stable aligns CI format checks with local development. Also fixes a 403 rate-limit issue where foundryup would fail fetching release tags from the GitHub API.
The CI stable toolchain is v1.7.1 which removes trailing blank lines before closing braces in empty contract bodies. Update local format to match.
Not actively monitored and Codecov token is not set up.
refcell
approved these changes
May 27, 2026
| - name: Run tests | ||
| run: forge test -v | ||
|
|
||
| fmt: |
Collaborator
There was a problem hiding this comment.
not sure if CI runs in order of definition or parallelizes, but fmt should be before test if sequential given it will fail faster
| function sharesToTokensRatioSlot() internal pure returns (bytes32) { return slotOf(SHARES_TO_TOKENS_RATIO_OFFSET); } | ||
| function usedAnnouncementIdsBaseSlot() internal pure returns (bytes32) { return slotOf(USED_ANNOUNCEMENT_IDS_OFFSET); } | ||
| function identifiersBaseSlot() internal pure returns (bytes32) { return slotOf(IDENTIFIERS_OFFSET); } | ||
| function sharesToTokensRatioSlot() internal pure returns (bytes32) { |
Collaborator
There was a problem hiding this comment.
I added ignore comments to keep these lean on other storage definitions. Mind adding those here and reverting the newlines? Same for the rest of the diff on this file
Collaborator
Author
There was a problem hiding this comment.
done - added // forgefmt: disable-start and end
ilikesymmetry
approved these changes
May 27, 2026
Use forgefmt: disable-next-item on each function to prevent forge fmt from expanding the compact lookup-table form.
Switch from per-function disable-next-item to a single block, and add the same to minimumRedeemableSlot / redeemPolicyIdsSlot.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
No CI exists on the repo. With audit kickoff on May 25, every PR should be automatically gated on compilation, tests, and formatting so reviewers and auditors can trust the green checkmark.
What changed
.github/workflows/ci.ymlwith three jobs that run on every push to main and every PR:forge build): catches compilation errors; contract sizes printed as a separate informational stepforge test -v): runs the full test suiteforge fmt --check): prevents unformatted code from landingAll jobs use
foundry-rs/foundry-toolchain@v1pinned tostable(currently v1.7.1).How it was tested