fix(ci): retry the dependency install on a lagging mirror
version / print-version (push) Successful in 2s
version / print-version (push) Successful in 2s
pacman aborted the transaction because one mirror answered 404 for a signature file, which happens while a mirror catches up with the package database. The databases are refreshed and the install retried instead of failing the release on the first attempt.
This commit is contained in:
1 file changed
+14
-5
@@ -44,11 +44,20 @@ jobs:
|
||||
echo "All the build dependencies are already installed."
|
||||
exit 0
|
||||
fi
|
||||
if ! sudo -n pacman -S --needed --noconfirm $missing; then
|
||||
echo "::error::could not install:$missing"
|
||||
echo '::error::give the runner user passwordless sudo for pacman or preinstall these packages.'
|
||||
exit 1
|
||||
fi
|
||||
# A mirror can lag behind the package database and answer 404 for a
|
||||
# signature that was just published, which aborts the whole
|
||||
# transaction: refresh the databases and retry before giving up.
|
||||
attempt=1
|
||||
until sudo -n pacman -Syy --needed --noconfirm $missing; do
|
||||
if [ "$attempt" -ge 3 ]; then
|
||||
echo "::error::could not install:$missing"
|
||||
echo '::error::give the runner user passwordless sudo for pacman or preinstall these packages.'
|
||||
exit 1
|
||||
fi
|
||||
attempt=$((attempt + 1))
|
||||
echo "::warning::pacman failed, retrying ($attempt/3)"
|
||||
sleep 15
|
||||
done
|
||||
|
||||
- name: Read the version file
|
||||
id: version
|
||||
|
||||
Reference in new issue
Block a user