feat: add bug-report flag (#1056)
* feat: add bug-report flag * fix: use docker host CPU count * feat: add config files to bug-report Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
@@ -9,9 +9,11 @@ import (
|
||||
"runtime"
|
||||
"strings"
|
||||
|
||||
"github.com/nektos/act/pkg/common"
|
||||
"github.com/nektos/act/pkg/model"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/nektos/act/pkg/common"
|
||||
"github.com/nektos/act/pkg/container"
|
||||
"github.com/nektos/act/pkg/model"
|
||||
)
|
||||
|
||||
// Runner provides capabilities to run GitHub actions
|
||||
@@ -171,7 +173,15 @@ func (runner *runnerImpl) NewPlanExecutor(plan *model.Plan) common.Executor {
|
||||
}
|
||||
pipeline = append(pipeline, common.NewParallelExecutor(maxParallel, stageExecutor...))
|
||||
}
|
||||
return common.NewParallelExecutor(runtime.NumCPU(), pipeline...)(ctx)
|
||||
var ncpu int
|
||||
info, err := container.GetHostInfo(ctx)
|
||||
if err != nil {
|
||||
log.Errorf("failed to obtain container engine info: %s", err)
|
||||
ncpu = 1 // sane default?
|
||||
} else {
|
||||
ncpu = info.NCPU
|
||||
}
|
||||
return common.NewParallelExecutor(ncpu, pipeline...)(ctx)
|
||||
})
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user