Skip to content

Commit

Permalink
ci: detect outdated abis (#398)
Browse files Browse the repository at this point in the history
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Workflow Enhancement**
- Added a new GitHub Actions job for generating and validating Solidity
contract ABIs
- Introduced automated checks to ensure ABI files are up to date with
source code

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
fbac authored Jan 10, 2025
1 parent 994f91e commit fc1f933
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/solidity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,45 @@ jobs:
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: contracts/output.sarif

abis:
needs: init
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Restore cache
uses: actions/cache/restore@v4
with:
path: contracts
key: ci-solidity-${{ github.ref }}

- name: Restore forge
uses: actions/download-artifact@v4
with:
name: forge
path: /usr/local/bin

- run: chmod +x /usr/local/bin/forge

- name: Setup Go
uses: actions/setup-go@v5

- name: Install abigen
run: go install github.com/ethereum/go-ethereum/cmd/[email protected]

- name: Generate ABIs
run: dev/generate

- name: Check for ABI changes
working-directory: ${{ github.workspace }}
run: |
if git diff --exit-code --ignore-space-change --ignore-all-space --ignore-cr-at-eol -- contracts/pkg; then
echo "No ABI changes detected."
else
echo "ERROR: Generated files are not up to date. Please run 'contracts/dev/generate' and commit the changes."
exit 1
fi

0 comments on commit fc1f933

Please sign in to comment.