Skip to content

[FEAT] Integrate Forge Gas Snapshot Diff Checker in Github Actions #649

Description

@mijinummi

Labels: good-first-issue, ci-cd, gas-optimization, gasguard
Difficulty: Easy
Module: .github/workflows/


🧠 Concept

Set up a GitHub Actions workflow that automatically compares gas snapshots generated by forge snapshot on pull requests against the baseline branch.

⚠️ Problem

Developers can introduce subtle gas regressions during refactoring without noticing unless gas diffs are surfaced directly in pull request reviews.

📁 Implementation Scope

  • .github/workflows/gas-diff.yml
  • scripts/compare-gas-snapshots.sh

🛠️ Requirements

  1. Run forge snapshot --check on pull request triggers.
  2. Generate a markdown table highlighting positive and negative gas deltas per test case.
  3. Post the summary table directly as a pull request comment.

🎯 Acceptance Criteria

  • Automated workflow posts clean gas diff markdown reports on pull requests.
  • Non-zero gas increases flag a status warning on the commit build.

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions