Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: limit diamond storage check API calls #884

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions .github/workflows/diamond-storage-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,24 @@ jobs:
with:
version: nightly

- id: set-matrix
- name: Narrow down test matrix scope to changed Dollar libraries to limit API requests
id: changed-libraries
uses: tj-actions/changed-files@v42
with:
files_yaml: |
libraries:
- packages/contracts/src/dollar/libraries/Lib*.sol

- name: Set contracts matrix
id: set-matrix
working-directory: packages/contracts
if: steps.changed-libraries.outputs.libraries_any_changed == 'true'
env:
CHANGED_LIBS: ${{ steps.changed-libraries.outputs.libraries_all_changed_files }}
run: |
forge tree | grep -E '^src/dollar/libraries/Lib' | cut -d' ' -f1 | xargs basename -a | cut -d'.' -f1 | xargs -I{} echo src/dollar/libraries/{}.sol:{} >> contracts.txt
for DIAMOND_LIB in "$CHANGED_LIBS"; do
echo ${DIAMOND_LIB} | xargs basename -a | cut -d'.' -f1 | xargs -I{} echo src/dollar/libraries/{}.sol:{} >> contracts.txt
done
echo "matrix=$(cat contracts.txt | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT

outputs:
Expand Down
Loading