Skip to content

Commit

Permalink
add ci job to check if anvil state is up to date
Browse files Browse the repository at this point in the history
  • Loading branch information
ricomateo committed Jan 28, 2025
1 parent 041ff96 commit 326f0bf
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/check-anvil-state.yml
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

0 comments on commit 326f0bf

Please sign in to comment.