Skip to content

ci: add PR checks and release workflows#2

Merged
jacderida merged 7 commits intomainfrom
ci/add-workflows
Mar 31, 2026
Merged

ci: add PR checks and release workflows#2
jacderida merged 7 commits intomainfrom
ci/add-workflows

Conversation

@grumbach
Copy link
Copy Markdown
Contributor

@grumbach grumbach commented Mar 31, 2026

Summary

  • Add merge.yml workflow for PR validation: cross-platform build, clippy, rustfmt, tests, and dry-run publish
  • Add release.yml workflow for publishing to crates.io via release-plz (manual trigger)
  • Add release-plz.toml config with tag format v{{ version }}

Bugfixes included

While getting CI green, fixed a few pre-existing issues:

  • Test compilation was broken: serde_json and dirs-next were optional deps behind the test-utils feature, but #[cfg(test)] code referenced them unconditionally. Moved both to [dev-dependencies] and removed the unused test-utils feature entirely (no consumer was using it).
  • test_smart_contract was failing: the duplicate payment test assumed the contract would always pick the same winner pool on a second call, but block.prevrandao changes between blocks so a different pool may be selected. Fixed the test to handle both outcomes correctly.
  • Dangling lib/prb-math submodule: a mode-160000 git entry with no .gitmodules config was blocking cargo git fetches. Removed the orphaned reference.
  • Anvil missing in CI: tests that spawn a local Ethereum node need Foundry installed. Added foundry-rs/foundry-toolchain@v1 to the test job.

Setup required

Two secrets need to be added to the repo settings (Settings > Secrets and variables > Actions):

Add merge.yml for PR validation (build, clippy, fmt, tests, dry-run publish)
and release.yml for publishing to crates.io via release-plz.
The test-utils feature was unused by any consumer. All cfg guards were
already #[cfg(any(test, feature = "test-utils"))], so the test code
compiled during cargo test anyway. Simplify by:
- Removing the test-utils feature entirely
- Moving dirs-next and serde_json to [dev-dependencies]
- Replacing cfg guards with plain #[cfg(test)]
The contract selects a winner pool using block.prevrandao. With 4 pools,
resubmitting the same data on a different block may select a different
winner, which is valid (each pool hash can only be paid once, but
different pools are independent). The test now correctly handles both
outcomes: PaymentAlreadyExists if same winner, or success with a
different winner verified against the original.
@grumbach grumbach closed this Mar 31, 2026
@grumbach grumbach reopened this Mar 31, 2026
jacderida and others added 2 commits March 31, 2026 13:12
This is a library crate — git tags and crates.io publishing are
sufficient; GitHub releases add no value. With releases disabled,
the default GITHUB_TOKEN can push tags, removing the need for the
EVMLIB_PAT secret entirely.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Breaking changes were introduced in recent PRs (testnet functions now
return Result types), so bump the minor version.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jacderida jacderida merged commit 09539b8 into main Mar 31, 2026
7 checks passed
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