ci: add CI job to check whether anvil state is up to date #6
Workflow file for this run
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
name: Check anvil dump | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [ '**' ] | |
env: | |
FOUNDRY_PROFILE: ci | |
jobs: | |
check: | |
strategy: | |
fail-fast: true | |
name: Check anvil dump | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./crates/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: | | |
cd contracts_deployed_anvil_state.json | |
cp 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: | | |
cd contracts_deployed_anvil_state.json | |
diff previous_state.json state.json |