Skip to content

Commit a681fe9

Browse files
authored
Retry on Rocky Linux Python install (#16190)
I'm not sure why these mirrors have been flaky lately. e.g. https://github.com/astral-sh/uv/actions/runs/18346934817/job/52256348387?pr=16182
1 parent 3c30e11 commit a681fe9

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2201,12 +2201,24 @@ jobs:
22012201
- name: "Install Python"
22022202
if: matrix.rocky-version == '8'
22032203
run: |
2204-
dnf install python39 python39-pip which -y
2204+
for i in {1..5}; do
2205+
dnf install python39 python39-pip which -y && break || { echo "Attempt $i failed, retrying in 10 seconds..."; sleep 10; }
2206+
if [ $i -eq 5 ]; then
2207+
echo "Failed to install Python after 5 attempts"
2208+
exit 1
2209+
fi
2210+
done
22052211
22062212
- name: "Install Python"
22072213
if: matrix.rocky-version == '9'
22082214
run: |
2209-
dnf install python3.9 python3.9-pip which -y
2215+
for i in {1..5}; do
2216+
dnf install python3.9 python3.9-pip which -y && break || { echo "Attempt $i failed, retrying in 10 seconds..."; sleep 10; }
2217+
if [ $i -eq 5 ]; then
2218+
echo "Failed to install Python after 5 attempts"
2219+
exit 1
2220+
fi
2221+
done
22102222
22112223
- name: "Install Python"
22122224
if: matrix.rocky-version == '10'

0 commit comments

Comments
 (0)