-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add workflow to check bindings are up to date (#243)
Fixes #207 ### What Changed? This PR introduces the following changes * Adds a CI workflow to check if the bindings are up to date. This works by re-generating the bindings and checking the diff against the existing bindings. * Changes the `make bindings` target to generate the bindings using a specific Foundry version. This is important since different Foundry versions may generate slightly different bindings, which will cause the CI to fail. To ensure a specific Foundry version is used, we run the command inside a Docker container that runs a pinned Foundry version (v0.3.0). * Updates the bindings by generating them with the modified `make bindings` target. **Note:** the existing `bindings` target was renamed to `bindings_host`, as it runs without Docker. However the `bindings_host` target is only for CI use only. To generate the bindings, please use the `bindings` target. ### Reviewer Checklist - [ ] New features are tested and documented - [ ] PR has one of the `changelog-X` labels (if applies) - [ ] Code deprecates any old functionality before removing it --------- Co-authored-by: Pablo Deymonnaz <[email protected]>
- Loading branch information
1 parent
d479799
commit 1a66fc2
Showing
7 changed files
with
89 additions
and
14 deletions.
There are no files selected for viewing
This file contains 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,50 @@ | ||
name: Bindings | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [ '**' ] | ||
|
||
env: | ||
FOUNDRY_PROFILE: ci | ||
|
||
jobs: | ||
check: | ||
strategy: | ||
fail-fast: true | ||
|
||
name: Check bindings are up to date | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
with: | ||
version: v0.3.0 | ||
|
||
- name: Show Forge version | ||
run: forge --version | ||
|
||
- name: Backup existing bindings | ||
working-directory: crates/utils/src/ | ||
run: | | ||
cp -r core/ existing_core/ | ||
cp -r middleware/ existing_middleware/ | ||
cp -r sdk/ existing_sdk/ | ||
- name: Generate new bindings | ||
run: | | ||
make bindings_host | ||
cargo fmt | ||
- name: Compare existing and new bindings | ||
working-directory: crates/utils/src/ | ||
run: | | ||
diff existing_core/ core/ | ||
diff existing_middleware/ middleware/ | ||
diff existing_sdk/ sdk/ |
This file contains 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 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 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
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.