-
Notifications
You must be signed in to change notification settings - Fork 128
46 lines (43 loc) · 1.57 KB
/
storage-checker.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Check Storage Layout
on:
pull_request:
branches:
- master
jobs:
check_storage:
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: "Generate and prepare the contract artifacts"
run: |
cd contracts && mkdir pr
for file in $(find src -name '*.sol'); do
contract_name=$(basename "$file" .sol)
forge inspect "$contract_name" storage --pretty > pr/"$contract_name".md
done
- name: Checkout Base Branch
env:
BASE: ${{ github.event.pull_request.base.sha }}
run: |
git fetch origin $BASE
git checkout $BASE
- name: "Generate and prepare the contract artifacts"
run: |
cd contracts && mkdir base
for file in $(find src -name '*.sol'); do
contract_name=$(basename "$file" .sol)
forge inspect "$contract_name" storage --pretty > base/"$contract_name".md
done
- name: Compare outputs
run: |
if ! diff --unified contracts/pr contracts/base; then
# Note: We are only creating a warning because storage changes might be intentional but should be looked into
# reach out to steven if you see a warning on this workflow and need help validating if it is expected or not
echo "::warning::Differences found between PR and base storage layouts"
fi