mirror of
https://gitea.com/gitea/act_runner.git
synced 2026-03-25 08:15:02 +01:00
refactor: move getContainerActionPaths into step interface (#13)
* allows to specialize local vs remote action implementation * allow paths like ./.. for local action Closes https://gitea.com/actions-oss/act-cli/issues/12 Reviewed-on: https://gitea.com/actions-oss/act-cli/pulls/13 Co-authored-by: ChristopherHX <christopher.homberger@web.de> Co-committed-by: ChristopherHX <christopher.homberger@web.de>
This commit is contained in:
committed by
ChristopherHX
parent
ee2e0135d5
commit
ce0890578a
@@ -19,8 +19,8 @@ type stepActionLocalMocks struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
func (salm *stepActionLocalMocks) runAction(step actionStep, actionDir string, remoteAction *remoteAction) common.Executor {
|
||||
args := salm.Called(step, actionDir, remoteAction)
|
||||
func (salm *stepActionLocalMocks) runAction(step actionStep) common.Executor {
|
||||
args := salm.Called(step)
|
||||
return args.Get(0).(func(context.Context) error)
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ func TestStepActionLocalTest(t *testing.T) {
|
||||
cm.On("GetContainerArchive", ctx, "/var/run/act/workflow/SUMMARY.md").Return(io.NopCloser(&bytes.Buffer{}), nil)
|
||||
cm.On("GetContainerArchive", ctx, "/var/run/act/workflow/pathcmd.txt").Return(io.NopCloser(&bytes.Buffer{}), nil)
|
||||
|
||||
salm.On("runAction", sal, filepath.Clean("/tmp/path/to/action"), (*remoteAction)(nil)).Return(func(_ context.Context) error {
|
||||
salm.On("runAction", sal).Return(func(_ context.Context) error {
|
||||
return nil
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user