Skip to content

Cache Foundry in CI, gate contract sizes, and finish CI on every main commit - #220

Merged
ryanio merged 2 commits into
mainfrom
ryan/ci-improvements
Nov 9, 2026
Merged

ryanio merged 2 commits into
mainfrom
ryan/ci-improvements

Conversation

@ryanio

@ryanio ryanio commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

Motivation

Solution

  • .github/actions/setup-foundry restores ~/.foundry/bin and ~/.foundry/versions (foundryup keeps the binaries in versions/ and links them from bin/) from the Actions cache, keyed on the runner OS and FOUNDRY_VERSION. It installs with foundry-toolchain only on a cache miss. All three jobs use it.
  • scripts/check_sizes.sh builds src/ (skipping tests and scripts) with forge 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.
  • A new push to a pull request still cancels its older run. Every other run gets its own concurrency group (github.run_id), so no run on main or a tag is cancelled or replaced while it waits.
  • Jobs get timeouts: 15 minutes for lint and 20 for tests and coverage.
  • The GOERLI_RPC_URL secret is gone from the jobs, since Goerli is shut down and nothing reads it.
  • Third-party actions (foundry-rs/foundry-toolchain, coverallsapp/github-action) are pinned to commit SHAs. GitHub's own actions stay on major tags.

Testing

  • ./scripts/check_sizes.sh passes locally on main with Foundry 1.9.0. Its tightest margin is ERC721SeaDropCloneable, with 3,522 runtime bytes left.
  • biome ci . passes.
  • This PR's first run fills the Foundry cache, and a re-run should restore it. I'll confirm that on this PR.

🤖 Generated with Claude Code

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>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Comment thread .github/workflows/test.yml Resolved
Comment thread scripts/check_sizes.sh Resolved
…p, and report sizes before failing

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ryanio
ryanio merged commit cfffd95 into main Nov 9, 2026
9 of 10 checks passed
@ryanio
ryanio deleted the ryan/ci-improvements branch November 9, 2026 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants