fix: always execute closeContainer() executor (#988)
* fix: always execute closeContainer() executor During our earlier refactoring in #984 we accidentally changed the behaviour in such a way that the `closeContainer()` executor was never called. This commit restores the earlier behaviour. Ref: * https://github.com/nektos/act/pull/984/files#diff-c057d66dc9657d8428e290c69871596e2b567bb8fecad62a99cab54398131a84L294 * https://github.com/nektos/act/pull/984/files#diff-ea9d5c93d769ef9b268932dd9990363e97fc3bec8a00114979d049bead5dd718R68 * test: add testcases to ensure job containers are started/stopped This commit adds tests to ensure that the executors of `startContainer`, `stopContainer`, `interpolateOutputs` and `closeContainer` are always called in the correct order.
This commit is contained in:
@@ -48,6 +48,7 @@ func newJobExecutor(info jobInfo) common.Executor {
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
steps = append(steps, func(ctx context.Context) error {
|
||||
err := info.stopContainer()(ctx)
|
||||
if err != nil {
|
||||
@@ -64,8 +65,5 @@ func newJobExecutor(info jobInfo) common.Executor {
|
||||
return nil
|
||||
})
|
||||
|
||||
return common.NewPipelineExecutor(steps...).Finally(info.interpolateOutputs()).Finally(func(ctx context.Context) error {
|
||||
info.closeContainer()
|
||||
return nil
|
||||
})
|
||||
return common.NewPipelineExecutor(steps...).Finally(info.interpolateOutputs()).Finally(info.closeContainer())
|
||||
}
|
||||
|
Reference in New Issue
Block a user