Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions .github/actions/install-sccache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,17 @@ runs:
# Release downloads fail transiently (e.g. HTTP 618, which `curl --retry` skips);
# manylinux_2_28's curl 7.61 lacks --retry-all-errors, so retry in the shell.
for attempt in 1 2 3 4 5; do
curl -fsSL -o "${tmp_dir}/${tarball}" "${url}" && break
[[ "${attempt}" -lt 5 ]] || exit 1
sleep 10
rc=0
curl -fsSL --connect-timeout 30 --max-time 300 -o "${tmp_dir}/${tarball}" "${url}" || rc=$?
if [[ "${rc}" -eq 0 ]]; then
break
elif [[ "${attempt}" -lt 5 ]]; then
echo "::warning::sccache download failed (attempt ${attempt}, curl exit ${rc}); retrying in 10s"
sleep 10
else
echo "::error::sccache download failed after ${attempt} attempts (curl exit ${rc}): ${url}"
exit "${rc}"
fi
done
(
cd "${tmp_dir}"
Expand Down
Loading