Skip to content

ci: add timeouts and fail-fast guards to the workflows - #298

Open
metif12 wants to merge 2 commits into
vlang:masterfrom
metif12:ci/fail-fast-guards-timeouts
Open

metif12 wants to merge 2 commits into
vlang:masterfrom
metif12:ci/fail-fast-guards-timeouts

Conversation

@metif12

@metif12 metif12 commented Oct 15, 2026

Copy link
Copy Markdown

None of this repository's workflows stop early: a hung step burns GitHub's 6 hour default because no job sets timeout-minutes, and a failed step still runs every step after it.

  • Every job without one gets a timeout-minutes (60 minutes generally; higher where the workload justifies it, e.g. benchmark and OS-image jobs).
  • Every step after the first gets an !cancelled() && steps.<previous>.outcome == 'success' guard, so a failure skips the remaining steps instead of spending the rest of the timeout. Steps that already carry their own condition keep it, and are never chained from.
  • Jobs that run V tests get VTEST_FAIL_FAST=1, which stops the test session after the first failing file (a red suite stays red).

This was applied mechanically and verified as a pure transformation: no step was added, removed, renamed or reordered, no run: command was touched, and no runner image or toolchain changed. The check suite confirms the step names and every run: line are identical to the base, the guard chain of each job is internally consistent, and formatting semantics are unchanged.

Every job gets a `timeout-minutes` so a hung step can no longer burn
GitHub's 6 hour default, and every step after the first gets an
`!cancelled() && steps.<previous>.outcome == 'success'` guard so a
failure skips the remaining work instead of running on. Jobs that run
V tests also get VTEST_FAIL_FAST=1, which stops the test session after
the first failing file (a red suite stays red).

No step was added, removed, renamed or reordered, and no `run:`
command was touched. Runner images and toolchains are unchanged.
Address review findings on the fail-fast change:

- Guards now read `success() && !cancelled() && steps.<prev>.outcome ==
  'success'`. A bare `!cancelled()` suppresses GitHub's implicit `success()`
  check, so a failure in a step outside the immediate chain would not have
  stopped later steps.
- A step that already carries a condition of our exact shape gets it replaced
  in place instead of gaining a second `if:` key, which is invalid workflow
  syntax. Steps whose condition is anything else (matrix picks, failure
  reporters such as `steps.x.outcome != 'success'`) keep it and stay out of
  the chain.
- Jobs that call a reusable workflow no longer get `timeout-minutes:` (GitHub
  forbids it there); the timeouts live on the jobs inside the called
  workflows instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant