From f602aa06fe19520930e175d5a9413340e52dd8c5 Mon Sep 17 00:00:00 2001 From: Pierre Warnier Date: Wed, 10 Jun 2026 12:43:39 +0200 Subject: [PATCH] ci: polish the image-build retry loop Address review feedback on #173: - Don't sleep after the final build attempt (no retry follows it). - Forward the workflow-wide CARGO_NET_RETRY into the container with a bare '-e CARGO_NET_RETRY' instead of re-hardcoding the value, keeping a single source of truth. --- .github/workflows/ci.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a9a644d..9f76f3b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,11 +71,14 @@ jobs: run: | for attempt in 1 2 3; do docker compose build ${{ matrix.target }} && exit 0 - echo "::warning::'${{ matrix.target }}' image build attempt $attempt failed (likely a registry timeout); retrying in 30s" - sleep 30 + if [ "$attempt" -lt 3 ]; then + echo "::warning::'${{ matrix.target }}' image build attempt $attempt failed (likely a registry timeout); retrying in 30s" + sleep 30 + fi done exit 1 - # CARGO_NET_RETRY is passed into the container so cargo retries crate - # downloads; a real test failure still fails fast (no step-level retry). + # Forward the workflow-wide CARGO_NET_RETRY into the container (single + # source of truth) so cargo retries crate downloads; a real test failure + # still fails fast (no step-level retry). - name: Test on ${{ matrix.target }} - run: docker compose run --rm -e CARGO_NET_RETRY=10 ${{ matrix.target }} cargo test --workspace + run: docker compose run --rm -e CARGO_NET_RETRY ${{ matrix.target }} cargo test --workspace