-
Notifications
You must be signed in to change notification settings - Fork 91
70 lines (57 loc) · 1.92 KB
/
core-contracts-storage-check.yml
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Check For Core Contracts Storage Changes
on:
push:
branches:
- development
pull_request:
jobs:
provide_contracts:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Foundry
uses: onbjerg/foundry-toolchain@v1
with:
version: nightly
- name: Narrow down test matrix scope to changed contracts to limit API requests
id: changed-contracts
uses: tj-actions/changed-files@v42
with:
files_yaml: |
contracts:
- packages/contracts/src/dollar/core/*.sol
- name: Set contracts matrix
id: set-matrix
working-directory: packages/contracts
if: steps.changed-contracts.outputs.contracts_any_changed == 'true'
env:
CHANGED_CONTRACTS: ${{ steps.changed-contracts.outputs.contracts_all_changed_files }}
run: |
for CONTRACT in "$CHANGED_CONTRACTS"; do
echo ${CONTRACT} | xargs basename -a | cut -d'.' -f1 | xargs -I{} echo src/dollar/core/{}.sol:{} >> contracts.txt
done
echo "matrix=$(cat contracts.txt | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
check_storage_layout:
needs: provide_contracts
runs-on: ubuntu-latest
strategy:
matrix:
contract: ${{ fromJSON(needs.provide_contracts.outputs.matrix) }}
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Foundry
uses: onbjerg/foundry-toolchain@v1
with:
version: nightly
- name: Check For Core Contracts Storage Changes
uses: Rubilmax/foundry-storage-check@main
with:
workingDirectory: packages/contracts
contract: ${{ matrix.contract }}
failOnRemoval: true