diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2e3847f9..c05642a8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 diff --git a/update-deps.sh b/update-deps.sh new file mode 100755 index 00000000..07b0490a --- /dev/null +++ b/update-deps.sh @@ -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."%