mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-08-11 17:50:58 +00:00
fix: skip local actions pre step in any case (#1204)
* fix: skip local actions pre step in any case We should skip local actions pre step, as it is not supported by github. In turn we may need to late prepare remote actions which are run as steps in a local composite action. Fixes #1193 * test: remove obsolete test case Since local actions does not run any pre-step anymore we don't test this case. Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
parent
70c44da5a6
commit
bb20108d52
3 changed files with 35 additions and 78 deletions
|
@ -92,52 +92,6 @@ func TestStepActionLocalTest(t *testing.T) {
|
|||
salm.AssertExpectations(t)
|
||||
}
|
||||
|
||||
func TestStepActionLocalPre(t *testing.T) {
|
||||
cm := &containerMock{}
|
||||
salm := &stepActionLocalMocks{}
|
||||
|
||||
ctx := context.Background()
|
||||
|
||||
sal := &stepActionLocal{
|
||||
readAction: salm.readAction,
|
||||
RunContext: &RunContext{
|
||||
StepResults: map[string]*model.StepResult{},
|
||||
ExprEval: &expressionEvaluator{},
|
||||
Config: &Config{
|
||||
Workdir: "/tmp",
|
||||
},
|
||||
Run: &model.Run{
|
||||
JobID: "1",
|
||||
Workflow: &model.Workflow{
|
||||
Jobs: map[string]*model.Job{
|
||||
"1": {
|
||||
Defaults: model.Defaults{
|
||||
Run: model.RunDefaults{
|
||||
Shell: "bash",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
JobContainer: cm,
|
||||
},
|
||||
Step: &model.Step{
|
||||
ID: "1",
|
||||
Uses: "./path/to/action",
|
||||
},
|
||||
}
|
||||
|
||||
salm.On("readAction", sal.Step, "/tmp/path/to/action", "", mock.Anything, mock.Anything).
|
||||
Return(&model.Action{}, nil)
|
||||
|
||||
err := sal.pre()(ctx)
|
||||
assert.Nil(t, err)
|
||||
|
||||
cm.AssertExpectations(t)
|
||||
salm.AssertExpectations(t)
|
||||
}
|
||||
|
||||
func TestStepActionLocalPost(t *testing.T) {
|
||||
table := []struct {
|
||||
name string
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue