Repository navigation
Cache Foundry in CI, gate contract sizes, and finish CI on every main commit - #220
Merged
Merged
Conversation
Restore Foundry from the Actions cache so a GitHub releases outage doesn't fail every job, check every src contract against EIP-170 and EIP-3860 with the tightest margins in the job summary, finish CI on every merged commit, add job timeouts, drop the dead Goerli secret and pin third-party actions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
The Foundry cache omits the version directory, so cache hits on fresh runners restore dangling symlinks and skip installation, causing all three CI jobs to fail.
3 open issues
What changed in this PR
This PR aims to make SeaDrop’s CI more resilient to Foundry download outages, enforce contract-size limits, and preserve CI results for every main commit.
Changes:
- Adds a shared Foundry setup action with caching and a pinned installer.
- Adds runtime and init-code size checks with a job-summary report.
- Adjusts workflow cancellation, adds timeouts, removes Goerli secrets, and pins Coveralls.
| File | Description |
|---|---|
scripts/check_sizes.sh |
Checks contract-size limits and reports the ten tightest margins. |
.github/workflows/test.yml |
Integrates setup and size checks; updates concurrency, timeouts, and dependencies. |
.github/actions/setup-foundry/action.yml |
Adds reusable cached Foundry installation and version reporting. |
Review effort: Balanced
…p, and report sizes before failing Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
cancel-in-progress: truealso applies to pushes onmain, so when two PRs merge close together, the first merge commit's run is cancelled and never gets a result.Solution
.github/actions/setup-foundryrestores~/.foundry/binand~/.foundry/versions(foundryup keeps the binaries inversions/and links them frombin/) from the Actions cache, keyed on the runner OS andFOUNDRY_VERSION. It installs withfoundry-toolchainonly on a cache miss. All three jobs use it.scripts/check_sizes.shbuildssrc/(skipping tests and scripts) withforge build --sizes --json. It fails if a contract it compiles is over 24,576 runtime bytes or 49,152 init code bytes. It prints the ten tightest margins, and writes them to the job summary, before failing. The test job runs it before the tests.github.run_id), so no run onmainor a tag is cancelled or replaced while it waits.GOERLI_RPC_URLsecret is gone from the jobs, since Goerli is shut down and nothing reads it.foundry-rs/foundry-toolchain,coverallsapp/github-action) are pinned to commit SHAs. GitHub's own actions stay on major tags.Testing
./scripts/check_sizes.shpasses locally onmainwith Foundry 1.9.0. Its tightest margin isERC721SeaDropCloneable, with 3,522 runtime bytes left.biome ci .passes.🤖 Generated with Claude Code