ci: stop pre-cloning an action that never runs - 22-36 s off every test leg #1688

Merged
jaylouisw merged 1 commit from ci/1116-1621 into main 2026-11-16 16:27:16 +00:00
Owner

What was slow

Every leg of Test (Node 18/20/22) paid 22-36 s before its first step, to pre-clone an action that never executes.

Baseline (run 3887, main 268ddd58, 16:20-16:22, all green):

job task duration gap before first step
Test (Node 18) 8604 81 s 28 s
Test (Node 20) 8605 83 s 27 s
Test (Node 22) 8606 93 s 32 s

The gap is the runner fetching actions/setup-node@v4 for the job's `uses:` list before any step runs:

16:20:54  ☁  git clone 'https://data.forgejo.org/actions/setup-node' # ref=v4
16:21:16  ⭐ Run Main actions/checkout@v4          <- 22 s later
16:22:08  skipping post step for 'actions/setup-node@v4'; main step was skipped

Same shape in earlier runs: 3877 (PR #1686) Node 22 = 32 s, 3884 = 36 s. In none of them did setup-node run - Node 20 excludes it by if:, and the 18/22 legs had already installed the pinned tarball. It was not an independent fallback either: setup-node downloads from nodejs.org/dist, the same host and tarball the step above it fetches.

Change

Removed the actions/setup-node@v4 fallback step. The hedge it provided is kept as a second attempt inside the download step: curl's own retries, then one more attempt after 5 s with a clean destination each time (so a truncated tarball cannot be bolted onto).

Verified in the real runner image (node:20-bookworm):

  • happy path, MAJOR=18: installed /usr/local/bin/node: v18.20.8 / npm 10.8.2
  • failure path (unreachable host): two attempts, exit 7, no fake runtime left behind, so The runtime is the version this leg is named for still fails the leg loudly

Coverage unchanged

  • matrix still [18, 20, 22], fail-fast: false, all three legs still run npm test + scripts/syntax-check.js and all four static checks and both example steps.
  • the major-version assertion step is byte-for-byte unchanged - it is what actually gates a wrong runtime.
  • no check weakened or removed; only a redundant second install path that never executed.
## What was slow Every leg of `Test (Node 18/20/22)` paid 22-36 s before its first step, to pre-clone an action that never executes. **Baseline (run 3887, main `268ddd58`, 16:20-16:22, all green):** | job | task | duration | gap before first step | |---|---|---|---| | Test (Node 18) | 8604 | 81 s | 28 s | | Test (Node 20) | 8605 | 83 s | 27 s | | Test (Node 22) | 8606 | 93 s | 32 s | The gap is the runner fetching `actions/setup-node@v4` for the job's \`uses:\` list before any step runs: ``` 16:20:54 ☁ git clone 'https://data.forgejo.org/actions/setup-node' # ref=v4 16:21:16 ⭐ Run Main actions/checkout@v4 <- 22 s later 16:22:08 skipping post step for 'actions/setup-node@v4'; main step was skipped ``` Same shape in earlier runs: 3877 (PR #1686) Node 22 = 32 s, 3884 = 36 s. In none of them did setup-node run - Node 20 excludes it by `if:`, and the 18/22 legs had already installed the pinned tarball. It was not an independent fallback either: `setup-node` downloads from `nodejs.org/dist`, the same host and tarball the step above it fetches. ## Change Removed the `actions/setup-node@v4` fallback step. The hedge it provided is kept as a second attempt *inside* the download step: curl's own retries, then one more attempt after 5 s with a clean destination each time (so a truncated tarball cannot be bolted onto). Verified in the real runner image (`node:20-bookworm`): - happy path, MAJOR=18: `installed /usr/local/bin/node: v18.20.8 / npm 10.8.2` - failure path (unreachable host): two attempts, exit 7, no fake runtime left behind, so `The runtime is the version this leg is named for` still fails the leg loudly ## Coverage unchanged - matrix still `[18, 20, 22]`, `fail-fast: false`, all three legs still run `npm test` + `scripts/syntax-check.js` and all four static checks and both example steps. - the major-version assertion step is byte-for-byte unchanged - it is what actually gates a wrong runtime. - no check weakened or removed; only a redundant second install path that never executed.
ci: stop pre-cloning an action that never runs - 22-36 s off every test leg
All checks were successful
CI / Classify the change (pull_request) Successful in 13s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 20s
CI / Server smoke test (pull_request) Successful in 18s
CI / Docker build (pull_request) Successful in 24s
CI / Test (Node 20) (pull_request) Successful in 55s
CI / Test (Node 18) (pull_request) Successful in 1m0s
CI / Test (Node 22) (pull_request) Successful in 1m1s
88fb4d0237
The test matrix kept actions/setup-node@v4 as a fallback for the pinned
Node tarball download. The runner pre-fetches every `uses:` action of a
job before its first step, including a step whose `if:` is false, and it
does not reuse that clone between runs - so all three legs paid for it:

  run 3877 (#1686) Node 22: setup-node cloned 16:14:17, first step 16:14:49
  (32 s), then 'skipping post step for actions/setup-node@v4; main step
  was skipped'. run 3884: 36 s. run 3887: 22 s / 27 s / 32 s.

The step never executed in any of them: Node 20 excludes it by `if:` and
the 18/22 legs had already installed from the tarball. It was never an
independent path either - setup-node fetches from nodejs.org/dist, the
same host and tarball the step already uses.

So the fallback is now a second attempt inside the step (curl's retries,
then one more after 5 s, with a clean dest each time), which keeps the
hedge without the pre-clone. The major-version assertion after it is
untouched, so the job still fails loudly if the runtime is not the one
the leg is named for.
jaylouisw scheduled this pull request to auto merge when all checks succeed 2026-11-16 16:27:08 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jaylouisw/packetforge!1688
No description provided.