File tree Expand file tree Collapse file tree 1 file changed +20
-3
lines changed
Expand file tree Collapse file tree 1 file changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -89,10 +89,27 @@ jobs:
8989 id : install_package_using_wheel
9090 run : |
9191 python3 -m pip uninstall -y openfl openfl-nightly
92+ # Install the package with retry logic
93+ MAX_ATTEMPTS=5
94+ WAIT_TIME_IN_SEC=20
9295 if [ "${{ env.TEST_PYPI }}" == "true" ]; then
93- python3 -m pip install -i https://test.pypi.org/simple/ openfl-nightly==${{ env.NEW_VERSION }}
96+ PIP_CMD=" python3 -m pip install -i https://test.pypi.org/simple/ openfl-nightly==${{ env.NEW_VERSION }}"
9497 else
95- python3 -m pip install openfl-nightly==${{ env.NEW_VERSION }}
98+ PIP_CMD="python3 -m pip install openfl-nightly==${{ env.NEW_VERSION }}"
99+ fi
100+ for i in $(seq 1 $MAX_ATTEMPTS); do
101+ if $PIP_CMD; then
102+ echo "Successfully installed openfl-nightly using command '$PIP_CMD'"
103+ break
104+ else
105+ echo "Attempt $i/$MAX_ATTEMPTS failed. Retrying in $WAIT_TIME_IN_SEC seconds..."
106+ sleep $WAIT_TIME_IN_SEC
107+ fi
108+ done
109+ # Check if the package was installed successfully
110+ if ! python3 -m pip show openfl-nightly > /dev/null; then
111+ echo "Failed to install openfl-nightly after $MAX_ATTEMPTS attempts."
112+ exit 1
96113 fi
97114 python3 -m pip install -r test-requirements.txt
98115
@@ -108,4 +125,4 @@ jobs:
108125 run : |
109126 echo "**Version:** $(pip list | grep openfl)" >> $GITHUB_STEP_SUMMARY
110127 echo "**Commit ID:** ${{ env.COMMIT_ID }}" >> $GITHUB_STEP_SUMMARY
111- echo "Package information printed successfully!"
128+ echo "Package information printed successfully!"
You can’t perform that action at this time.
0 commit comments