Skip to content

Commit 4ce4184

Browse files
ci: make the Docker test matrix resilient to registry flakes (#172) (#173)
The Test (debian/alpine/fedora) matrix failed four times in a row on 2026-06-10, each on a transient network error (Docker Hub base-image pull i/o timeout; crates.io download broken pipe) unrelated to the code. - fail-fast: false so one distro's flake no longer cancels the others. - Retry 'docker compose build <target>' (the Docker Hub pull) with backoff. - Pass CARGO_NET_RETRY into the container and set it for runner-native jobs so cargo retries crate downloads; real test failures still fail fast (no step-level retry around the test run). No new third-party actions — a shell retry loop keeps the supply-chain surface unchanged. Closes #172.
1 parent 27daa7b commit 4ce4184

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ on:
77

88
env:
99
CARGO_TERM_COLOR: always
10+
# Ride out transient crates.io/registry blips instead of failing the job.
11+
CARGO_NET_RETRY: "10"
1012

1113
jobs:
1214
fmt:
@@ -57,8 +59,23 @@ jobs:
5759
if: github.event_name == 'push'
5860
runs-on: ubuntu-latest
5961
strategy:
62+
# One distro's transient registry timeout must not cancel the others.
63+
fail-fast: false
6064
matrix:
6165
target: [debian, alpine, fedora]
6266
steps:
6367
- uses: actions/checkout@v6
64-
- run: docker compose run --rm ${{ matrix.target }} cargo test --workspace
68+
# Base images are pulled from Docker Hub at build time; retry to ride
69+
# out transient registry timeouts that would otherwise fail the job.
70+
- name: Build ${{ matrix.target }} image
71+
run: |
72+
for attempt in 1 2 3; do
73+
docker compose build ${{ matrix.target }} && exit 0
74+
echo "::warning::'${{ matrix.target }}' image build attempt $attempt failed (likely a registry timeout); retrying in 30s"
75+
sleep 30
76+
done
77+
exit 1
78+
# CARGO_NET_RETRY is passed into the container so cargo retries crate
79+
# downloads; a real test failure still fails fast (no step-level retry).
80+
- name: Test on ${{ matrix.target }}
81+
run: docker compose run --rm -e CARGO_NET_RETRY=10 ${{ matrix.target }} cargo test --workspace

0 commit comments

Comments
 (0)