Skip to content

Commit

Permalink
ci: add job to check the bindings are up to date (#475)
Browse files Browse the repository at this point in the history
  • Loading branch information
ricomateo authored Jan 30, 2025
1 parent 96adf25 commit 4286221
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 2 deletions.
78 changes: 78 additions & 0 deletions .github/workflows/bindings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Bindings

on:
push:
branches:
- dev
pull_request:
merge_group:

permissions:
contents: read

jobs:
generate_bindings:
name: Generate bindings
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Install go1.21
uses: actions/setup-go@v5
with:
go-version: "1.21"

- name: Add Ethereum PPA
run: sudo add-apt-repository -y ppa:ethereum/ethereum

- name: Install Abigen
run: sudo apt-get update && sudo apt-get install ethereum

- name: Show abigen version
run: abigen --version

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: v0.3.0

- name: Run make bindings
run: make bindings

check_bindings:
name: Check bindings are up-to-date
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

# This step is needed to know if the contracts were changed.
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
contracts:
- 'contracts/lib/**'
- 'contracts/script/**'
- 'contracts/src/**'
bindings:
- 'contracts/bindings/**'
# This step runs only if some contract changed.
# It checks whether the bindings directory have changed.
# If there are no changes, then the bindings are outdated
# and therefore this step will fail.
- name: Check the bindings are up-to-date
if: steps.filter.outputs.contracts == 'true'
run: |
BINDINGS_UPDATED=${{ steps.filter.outputs.bindings }}
if [[ "$BINDINGS_UPDATED" == "false" ]]; then
echo "The bindings are outdated";
exit 1
fi
6 changes: 4 additions & 2 deletions chainio/clients/eigenpod/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
# of the EigenPods client, we need to generate the bindings for the contracts in the feat/partial-withdrawal-batching branch.
# Once eigenlayer-contracts repo is stable and features are on single branch, we can move the bindings back to normal process

set -e

TMP_DIR=$(mktemp -d)
BINDINGS_DIR=bindings

Expand All @@ -16,7 +18,7 @@ cleanup_bindings_dir() {

clone() {
echo "Cloning the EigenLayer contracts repository"
git clone -b slashing-magnitudes --depth=1 git@github.com:Layr-Labs/eigenlayer-contracts.git "${TMP_DIR}"
git clone -b slashing-magnitudes --depth=1 https://github.com/Layr-Labs/eigenlayer-contracts.git "${TMP_DIR}"
}

generate_bindings() {
Expand Down Expand Up @@ -56,4 +58,4 @@ main() {
cleanup
}

main
main

0 comments on commit 4286221

Please sign in to comment.