diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9e2e65f..35e40c6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -74,8 +74,9 @@ jobs: echo "Building: $(tr '\n' ' ' < checks.txt)" - name: Build checks # Helm charts download from GitHub release pages, which time out now - # and then (504). Retry only for that: what downloaded stays in the - # store, and real failures still fail on the first attempt. + # and then (504), and the VM tests' images from registries, which + # do too. Retry only for those: what downloaded stays in the store, + # and real failures still fail on the first attempt. run: | for attempt in 1 2 3; do set +e @@ -85,14 +86,14 @@ jobs: status=${PIPESTATUS[0]} set -e [ "$status" = 0 ] && exit 0 - grep -qE 'failed to fetch https://github\.com/[^ ]+ : 5[0-9][0-9]' build.log || exit "$status" - echo "::warning::A GitHub release download failed; retrying (attempt $attempt of 3)" + grep -qE 'failed to fetch https://github\.com/[^ ]+ : 5[0-9][0-9]|docker-image-[^ ]*> FATA' build.log || exit "$status" + echo "::warning::A chart or image download failed; retrying (attempt $attempt of 3)" sleep 30 done exit 1 - # Cache new chart downloads (only those: everything else is rebuilt - # cheaply), even when the build failed further on. - - name: Push chart downloads to the binary cache + # Cache new chart and image downloads (only those: everything else is + # rebuilt cheaply), even when the build failed further on. + - name: Push chart and image downloads to the binary cache if: always() env: CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} @@ -101,8 +102,8 @@ jobs: [ -n "$CACHIX_AUTH_TOKEN" ] || { echo "No CACHIX_AUTH_TOKEN; not pushing."; exit 0; } shopt -s nullglob charts=() - for p in /nix/store/*-helm-chart-*; do - [[ "$(basename "$p")" =~ ^[a-z0-9]{32}-helm-chart- && "$p" != *.drv ]] && charts+=("$p") + for p in /nix/store/*-helm-chart-* /nix/store/*-docker-image-*.tar; do + [[ "$(basename "$p")" =~ ^[a-z0-9]{32}-(helm-chart|docker-image)- && "$p" != *.drv ]] && charts+=("$p") done [ ${#charts[@]} = 0 ] || cachix push thatbagu0nixlab "${charts[@]}"