Skip to content

Commit

Permalink
chore: limit diamond storage check API calls
Browse files Browse the repository at this point in the history
Narrow down test matrix scope to changed Dollar libraries

Resolves: #876
  • Loading branch information
gitcoindev committed Jan 24, 2024
1 parent 1f19cd0 commit 6a0e878
Showing 1 changed file with 16 additions and 2 deletions.
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

0 comments on commit 6a0e878

Please sign in to comment.