-
Notifications
You must be signed in to change notification settings - Fork 3.9k
feat: contract check runner #18553
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
feat: contract check runner #18553
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
20cef47
feat: fast check runner for contracts
smartcontracts 446aabd
feat: further script improvements
smartcontracts a41a0c2
fix: lint
smartcontracts 15e5c78
fix: comments
smartcontracts f4fa4e7
feat: add fast checks to ci
smartcontracts 970139c
fix: add missing checks
smartcontracts d3b28a7
fix: corrected caching logic
smartcontracts 8bb123f
fix: handle interface check bugs
smartcontracts File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| # Check Runner Configuration | ||
| # | ||
| # Phases run sequentially, top to bottom. | ||
| # Within each phase, checks run in parallel (unless parallel: false). | ||
| # Dependencies within a phase are respected. | ||
| # | ||
| # Phase fields: | ||
| # - name: Phase identifier (shown in output) | ||
| # - build: (optional) Build command to run before checks | ||
| # - parallel: (optional) Whether checks run in parallel (default: true) | ||
| # - checks: List of checks to run | ||
| # | ||
| # Check fields: | ||
| # - name: Unique identifier | ||
| # - description: Human-readable description | ||
| # - command: Shell command to run | ||
| # - depends: (optional) Checks that must complete first (within same phase) | ||
| # - retry-clean: (optional) If true, retry with clean build on failure | ||
|
|
||
| phases: | ||
| # Phase 1: Setup - runs sequentially | ||
| - name: setup | ||
| parallel: false | ||
| checks: | ||
| - name: lint-fix | ||
| description: Fix code formatting | ||
| command: forge fmt || true | ||
|
|
||
| # Phase 2: Pre-build checks - no compilation needed | ||
| - name: pre-build | ||
| checks: | ||
| - name: lint | ||
| description: Check code formatting | ||
| command: forge fmt --check | ||
| - name: semgrep | ||
| description: Run semgrep security linter | ||
| command: cd ../../ && semgrep scan --config .semgrep/rules/ ./packages/contracts-bedrock | ||
| - name: semgrep-test-validity | ||
| description: Check semgrep tests are valid | ||
| command: forge fmt ../../.semgrep/tests/sol-rules.t.sol --check | ||
| - name: deploy-configs | ||
| description: Validate deploy configurations | ||
| command: ./scripts/checks/check-deploy-configs.sh | ||
| - name: kontrol-summaries | ||
| description: Check kontrol summaries unchanged | ||
| command: ./scripts/checks/check-kontrol-summaries-unchanged.sh | ||
|
|
||
| # Phase 3: Source build checks - production contracts only | ||
| - name: source | ||
| build: just build-source | ||
| checks: | ||
| - name: snapshots | ||
| description: Check snapshots are up to date | ||
| command: go run ./scripts/autogen/generate-snapshots . && go run scripts/autogen/generate-semver-lock/main.go | ||
| - name: semver-diff | ||
| description: Check semver changes match lock changes | ||
| command: ./scripts/checks/check-semver-diff.sh | ||
| depends: | ||
| - snapshots | ||
| - name: unused-imports | ||
| description: Check for unused imports | ||
| command: go run ./scripts/checks/unused-imports | ||
| - name: strict-pragma | ||
| description: Check strict pragma versions | ||
| command: go run ./scripts/checks/strict-pragma | ||
| - name: valid-semver | ||
| description: Check valid semver versions | ||
| command: go run ./scripts/checks/valid-semver-check/main.go | ||
| - name: spacers | ||
| description: Validate storage spacers | ||
| command: go run ./scripts/checks/spacers | ||
| - name: reinitializers | ||
| description: Check reinitializer modifiers | ||
| command: go run ./scripts/checks/reinitializer | ||
| - name: interfaces | ||
| description: Check interface correctness | ||
| command: go run ./scripts/checks/interfaces | ||
| retry-clean: true | ||
| - name: size-check | ||
| description: Check contract sizes | ||
| command: forge build --sizes --skip "/**/test/**" --skip "/**/scripts/**" | ||
| - name: opcm-upgrade-checks | ||
| description: Check OPCM upgrade methods | ||
| command: go run ./scripts/checks/opcm-upgrade-checks/ | ||
|
|
||
| # Phase 4: Dev build checks - needs test artifacts | ||
| - name: dev | ||
| build: just forge-build-dev | ||
| checks: | ||
| - name: forge-test-names | ||
| description: Validate forge test conventions | ||
| command: go run ./scripts/checks/test-validation | ||
|
smartcontracts marked this conversation as resolved.
|
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.