Skip to content

Commit

Permalink
ci: add script to recursive update dep
Browse files Browse the repository at this point in the history
  • Loading branch information
TuDo1403 committed Aug 21, 2024
1 parent 5565988 commit e06d540
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ jobs:
with:
version: nightly

- name: Update package with soldeer
run: forge soldeer update

- name: Recursively update dependencies
run: |
chmod +x ./update-deps.sh
./update-deps.sh
id: update-deps

- name: Run Forge build
run: |
forge --version
Expand Down
40 changes: 40 additions & 0 deletions update-deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash

# Set the path to the dependencies folder
DEPENDENCIES_FOLDER="./dependencies"

# Check if the dependencies folder exists
if [ ! -d "$DEPENDENCIES_FOLDER" ]; then
echo "Dependencies folder does not exist: $DEPENDENCIES_FOLDER"
exit 1
fi

# Change directory to the dependencies folder
cd "$DEPENDENCIES_FOLDER" || exit 1

# Iterate through each subdirectory in the dependencies folder
for dir in */; do
if [ -d "$dir" ]; then
echo "Updating dependencies in: $dir"
cd "$dir" || exit 1

# Check if soldeer.lock exists
if [ ! -f "soldeer.lock" ]; then
echo "soldeer.lock does not exist in: $dir"
echo "Skipping update for: $dir"
cd ..
continue
fi

# Run soldeer update
forge soldeer update

# Return to the dependencies folder
cd ..
fi
done

# Return to the original directory
cd ..

echo "All dependencies updated."%

0 comments on commit e06d540

Please sign in to comment.