diff --git a/.github/actions/install-sccache/action.yml b/.github/actions/install-sccache/action.yml index c719f5729a9..509d59dae41 100644 --- a/.github/actions/install-sccache/action.yml +++ b/.github/actions/install-sccache/action.yml @@ -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}"