Skip to content

Commit

Permalink
Merge branch 'dev' into refactor/improve-key-management-interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
maximopalopoli authored Jan 31, 2025
2 parents ef536bb + 5d282a5 commit 98de9d7
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/check-anvil-state.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Check anvil state
on:
push:
branches:
- dev
pull_request:
merge_group:

jobs:
generate-anvil-state:
name: generate anvil state
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: stable

- name: Generate anvil state
run: make deploy-contracts-to-anvil-and-save-state

check-anvil-state:
name: Check anvil dump is up-to-date
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

# 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/**'
anvil_state:
- 'contracts/anvil/contracts-deployed-anvil-state.json'
# This step runs only if some contract changed.
# It checks whether the anvil state has changed.
# If there are no changes, then the anvil state is outdated
# and therefore this step will fail.
- name: Check the anvil state is up-to-date
if: steps.filter.outputs.contracts == 'true'
run: |
ANVIL_STATE_UPDATED=${{ steps.filter.outputs.anvil_state }}
if [[ "$ANVIL_STATE_UPDATED" == "false" ]]; then
echo "The anvil state is outdated";
exit 1
fi
40 changes: 40 additions & 0 deletions .github/workflows/contracts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Contracts CI

on:
push:
branches: [main]
pull_request:
branches: [ '**' ]

env:
FOUNDRY_PROFILE: ci

jobs:
check:
strategy:
fail-fast: true

name: Foundry project
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./contracts

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

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: stable

- name: Show Forge version
run: forge --version

- name: Run Forge fmt
run: forge fmt --check

- name: Run Forge build
run: forge build

0 comments on commit 98de9d7

Please sign in to comment.