-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add a workflow to generate storage artifacts
- Loading branch information
Showing
1 changed file
with
59 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Generate Storage Artifacts | ||
|
||
on: | ||
workflow_dispatch | ||
|
||
jobs: | ||
provide_contracts: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Install Foundry | ||
uses: onbjerg/foundry-toolchain@v1 | ||
with: | ||
version: nightly | ||
|
||
- name: Set contracts matrix for all matching contracts | ||
id: set-matrix | ||
working-directory: packages/contracts | ||
run: | | ||
# Find all contracts matching the patterns in core and libraries | ||
find src/dollar/core -name '*.sol' > contracts.txt | ||
find src/dollar/libraries -name 'Lib*.sol' >> contracts.txt | ||
# Generate the matrix from the list of contracts | ||
if [ -s contracts.txt ]; then | ||
echo "matrix=$(cat contracts.txt | jq -R -s -c 'split(\"\n\")[:-1]')" >> $GITHUB_OUTPUT | ||
fi | ||
outputs: | ||
matrix: ${{ steps.set-matrix.outputs.matrix }} | ||
|
||
check_storage_layout: | ||
needs: provide_contracts | ||
runs-on: ubuntu-latest | ||
if: ${{ needs.provide_contracts.outputs.matrix != '[]' && needs.provide_contracts.outputs.matrix != '' }} | ||
|
||
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 }} |