Skip to content

Commit 13e5123

Browse files
Retry apt package installs in CI
Ubuntu's security mirror twice returned 404 for a package that had just been replaced (libexpat1), failing the install-deb job for unrelated reasons. Each apt step now refreshes the index and retries up to three times, 30 seconds apart. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FV3o3TZ5zZ2ACWD2S7EZdc
1 parent f415432 commit 13e5123

1 file changed

Lines changed: 24 additions & 3 deletions

File tree

‎.github/workflows/linux-packages.yml‎

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,14 @@ jobs:
3232
with:
3333
components: clippy
3434
- name: Install build dependencies
35-
run: sudo apt-get update && sudo apt-get install -y libwebkit2gtk-4.1-dev build-essential libssl-dev libayatana-appindicator3-dev librsvg2-dev
35+
run: |
36+
# Mirrors can briefly 404 a package just replaced by an update; refresh and retry.
37+
for attempt in 1 2 3; do
38+
sudo apt-get update && sudo apt-get install -y libwebkit2gtk-4.1-dev build-essential libssl-dev libayatana-appindicator3-dev librsvg2-dev && exit 0
39+
echo "apt attempt $attempt failed; retrying in 30 seconds" >&2
40+
sleep 30
41+
done
42+
exit 1
3643
- name: Install checksum-pinned Restic for restore integration tests
3744
run: |
3845
curl -fsSL https://github.com/restic/restic/releases/download/v0.19.1/restic_0.19.1_linux_amd64.bz2 -o /tmp/restic-ci.bz2
@@ -54,7 +61,14 @@ jobs:
5461
DEBIAN_FRONTEND: noninteractive
5562
steps:
5663
- name: Install build tools
57-
run: apt-get update && apt-get install -y curl ca-certificates git build-essential pkg-config file libssl-dev libwebkit2gtk-4.1-dev libayatana-appindicator3-dev librsvg2-dev patchelf python3 binutils libarchive-tools
64+
run: |
65+
# Mirrors can briefly 404 a package just replaced by an update; refresh and retry.
66+
for attempt in 1 2 3; do
67+
apt-get update && apt-get install -y curl ca-certificates git build-essential pkg-config file libssl-dev libwebkit2gtk-4.1-dev libayatana-appindicator3-dev librsvg2-dev patchelf python3 binutils libarchive-tools && exit 0
68+
echo "apt attempt $attempt failed; retrying in 30 seconds" >&2
69+
sleep 30
70+
done
71+
exit 1
5872
- uses: actions/checkout@v4
5973
- uses: actions/setup-node@v4
6074
with:
@@ -90,7 +104,14 @@ jobs:
90104
- name: Verify checksums
91105
run: cd packages && sha256sum --check SHA256SUMS
92106
- name: Install package and launch-test tools
93-
run: apt-get update && apt-get install -y ./packages/*.deb xvfb xauth dbus dbus-x11 libnotify-bin
107+
run: |
108+
# Mirrors can briefly 404 a package just replaced by an update; refresh and retry.
109+
for attempt in 1 2 3; do
110+
apt-get update && apt-get install -y ./packages/*.deb xvfb xauth dbus dbus-x11 libnotify-bin && exit 0
111+
echo "apt attempt $attempt failed; retrying in 30 seconds" >&2
112+
sleep 30
113+
done
114+
exit 1
94115
- name: Launch installed application as a normal user
95116
run: useradd -m smoke && runuser -u smoke -- bash scripts/smoke-desktop.sh /usr/bin/command-center
96117

0 commit comments

Comments
 (0)