feat: add --failfast and failtest: true to control dependencies (#2525)

This commit is contained in:
Andrey Nering
2025-12-07 17:23:08 -03:00
committed by GitHub
parent 54e4905432
commit 9b99866224
24 changed files with 180 additions and 2 deletions

10
task.go
View File

@@ -78,7 +78,10 @@ func (e *Executor) Run(ctx context.Context, calls ...*Call) error {
return err
}
g, ctx := errgroup.WithContext(ctx)
g := &errgroup.Group{}
if e.Failfast {
g, ctx = errgroup.WithContext(ctx)
}
for _, c := range regularCalls {
if e.Parallel {
g.Go(func() error { return e.RunTask(ctx, c) })
@@ -257,7 +260,10 @@ func (e *Executor) mkdir(t *ast.Task) error {
}
func (e *Executor) runDeps(ctx context.Context, t *ast.Task) error {
g, ctx := errgroup.WithContext(ctx)
g := &errgroup.Group{}
if e.Failfast || t.Failfast {
g, ctx = errgroup.WithContext(ctx)
}
reacquire := e.releaseConcurrencyLimit()
defer reacquire()