Skip to content

Commit 20f7eea

Browse files
Cache vexctl on Linux and Windows too (#2039)
The required coverage job and the Windows test legs download vexctl from a github.com release on every run. On 2026-11-09 those downloads returned 504 for minutes at a time (05:43 and 06:11 UTC), longer than curl's ~30s of retries. That failed coverage (2) on PR #2018 and test (windows-latest, 1) on the nightly; in the merge queue it would evict the entry. Restore the binary from the actions cache on every OS, as macOS already does, and download only on a miss. The restored file is still checked against the pinned sha256. Saves stay main-only. Claude-Session: https://claude.ai/code/session_011f9aeQtKqZexk5DRhSS2Gg Co-authored-by: Claude <noreply@anthropic.com>
1 parent 53286d4 commit 20f7eea

1 file changed

Lines changed: 49 additions & 13 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 49 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -461,16 +461,21 @@ jobs:
461461
go-version: '1.24.13' # exact: bump deliberately (#1645)
462462
cache: false
463463

464-
- name: Restore vexctl (macOS)
464+
- name: Restore vexctl
465465
# The macOS compile below took a median 110s (max 168s) of every
466466
# macOS `test` job and is the step's only network flake source
467-
# (sum.golang.org resets). Its output depends only on the vexctl
468-
# version, the Go toolchain and the runner, so it is cached under
469-
# exactly those. Saved from main only, like the cargo cache.
467+
# (sum.golang.org resets). On Linux and Windows the release
468+
# download is the only network step, and github.com release
469+
# downloads return 504 for minutes at a time (2026-11-09 05:43 and
470+
# 06:11 UTC), longer than curl's retries wait. The binary depends
471+
# only on the vexctl version, the Go toolchain and the runner, so
472+
# it is cached under exactly those. Saved from main only, like the
473+
# cargo cache.
470474
id: vexctl-cache
471-
if: needs.release-readiness.outputs.reuse != 'true' && runner.os == 'macOS'
475+
if: needs.release-readiness.outputs.reuse != 'true'
472476
uses: actions/cache/restore@caa296126883cff596d87d8935842f9db880ef25 # v5.1.0
473-
# Capped like `Cache cargo`: a miss only means compiling vexctl.
477+
# Capped like `Cache cargo`: a miss only means fetching or
478+
# compiling vexctl.
474479
timeout-minutes: 5
475480
continue-on-error: true
476481
with:
@@ -516,8 +521,11 @@ jobs:
516521
*) asset='' ;;
517522
esac
518523
if [ -n "$asset" ]; then
519-
curl -fsSL --retry 5 --retry-all-errors --ssl-revoke-best-effort -o "$dir/$bin" \
520-
"https://github.com/openvex/vexctl/releases/download/$VEXCTL_VERSION/$asset"
524+
# A restored binary is checked against the same sha256.
525+
if [ "$CACHE_HIT" != true ] || [ ! -f "$dir/$bin" ]; then
526+
curl -fsSL --retry 5 --retry-all-errors --ssl-revoke-best-effort -o "$dir/$bin" \
527+
"https://github.com/openvex/vexctl/releases/download/$VEXCTL_VERSION/$asset"
528+
fi
521529
echo "$sha $dir/$bin" | sha256sum -c -
522530
chmod +x "$dir/$bin"
523531
"$dir/$bin" version
@@ -540,10 +548,9 @@ jobs:
540548
"$dir/vexctl" version
541549
echo "$dir" >> "$GITHUB_PATH"
542550
543-
- name: Save vexctl (macOS)
551+
- name: Save vexctl
544552
if: >-
545553
needs.release-readiness.outputs.reuse != 'true'
546-
&& runner.os == 'macOS'
547554
&& github.ref == 'refs/heads/main'
548555
&& steps.vexctl-cache.outputs.cache-hit != 'true'
549556
&& steps.vexctl-cache.outcome == 'success'
@@ -667,6 +674,8 @@ jobs:
667674
timeout-minutes: 35
668675
permissions:
669676
contents: read
677+
env:
678+
VEXCTL_VERSION: v0.3.0
670679
steps:
671680
- name: Checkout
672681
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
@@ -714,23 +723,50 @@ jobs:
714723
go-version: '1.24.13' # exact: bump deliberately (#1645)
715724
cache: false
716725

726+
- name: Restore vexctl
727+
# Cached like `test`'s vexctl so a github.com release outage
728+
# doesn't fail this required job. Saved from main by shard 1.
729+
id: vexctl-cache
730+
if: needs.release-readiness.outputs.reuse != 'true'
731+
uses: actions/cache/restore@caa296126883cff596d87d8935842f9db880ef25 # v5.1.0
732+
timeout-minutes: 5
733+
continue-on-error: true
734+
with:
735+
path: ${{ runner.temp }}/vexctl-bin
736+
key: vexctl-${{ env.VEXCTL_VERSION }}-${{ runner.os }}-${{ runner.arch }}-coverage
737+
717738
- name: Install vexctl
718739
if: needs.release-readiness.outputs.reuse != 'true'
719740
# The v0.3.0 Linux release binary, as in `test`'s vexctl step.
720741
env:
721-
VEXCTL_VERSION: v0.3.0
722742
VEXCTL_SHA256_LINUX_AMD64: cd7f8b57d20642166ed4eb3dd1fd849bbb30bbd7c5b9f5b0316b6003b57ceaba
743+
CACHE_HIT: ${{ steps.vexctl-cache.outputs.cache-hit }}
723744
run: |
724745
set -euo pipefail
725746
dir="$RUNNER_TEMP/vexctl-bin"
726747
mkdir -p "$dir"
727-
curl -fsSL --retry 5 --retry-all-errors -o "$dir/vexctl" \
728-
"https://github.com/openvex/vexctl/releases/download/$VEXCTL_VERSION/vexctl-linux-amd64"
748+
# A restored binary is checked against the same sha256.
749+
if [ "$CACHE_HIT" != true ] || [ ! -f "$dir/vexctl" ]; then
750+
curl -fsSL --retry 5 --retry-all-errors -o "$dir/vexctl" \
751+
"https://github.com/openvex/vexctl/releases/download/$VEXCTL_VERSION/vexctl-linux-amd64"
752+
fi
729753
echo "$VEXCTL_SHA256_LINUX_AMD64 $dir/vexctl" | sha256sum -c -
730754
chmod +x "$dir/vexctl"
731755
"$dir/vexctl" version
732756
echo "$dir" >> "$GITHUB_PATH"
733757
758+
- name: Save vexctl
759+
if: >-
760+
needs.release-readiness.outputs.reuse != 'true'
761+
&& github.ref == 'refs/heads/main'
762+
&& matrix.shard == 1
763+
&& steps.vexctl-cache.outputs.cache-hit != 'true'
764+
&& steps.vexctl-cache.outcome == 'success'
765+
uses: actions/cache/save@caa296126883cff596d87d8935842f9db880ef25 # v5.1.0
766+
with:
767+
path: ${{ runner.temp }}/vexctl-bin
768+
key: ${{ steps.vexctl-cache.outputs.cache-primary-key }}
769+
734770
- name: Run tests with coverage
735771
if: needs.release-readiness.outputs.reuse != 'true'
736772
# Two-step pattern: `--no-report` runs instrumented tests and

0 commit comments

Comments
 (0)