-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add ci job to check if anvil state is up to date
- Loading branch information
Showing
1 changed file
with
39 additions
and
0 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,39 @@ | ||
name: check anvil state up-to-date | ||
on: | ||
push: | ||
branches: | ||
- dev | ||
pull_request: | ||
merge_group: | ||
|
||
jobs: | ||
check_anvil_dump: | ||
strategy: | ||
fail-fast: true | ||
|
||
name: Check anvil dump state is up to date | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./contracts/anvil | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
with: | ||
version: stable | ||
|
||
- name: Backup existing anvil dump state | ||
run: cp contracts-deployed-anvil-state.json previous-state.json | ||
|
||
- name: Generate new anvil dump state | ||
run: ./deploy-contracts-save-anvil-state.sh | ||
|
||
- name: Check whether the anvil dump state has changed | ||
run: | | ||
jq --sort-keys . previous_state.json > previous_state.json | ||
jq --sort-keys . contracts-deployed-anvil-state.json > state.json | ||
diff previous_state.json state.json |