mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-08-11 17:50:58 +00:00
Throw an error if the steps has a invalid uses directive (#500)
* Throw an error if the steps has a invalid uses directive * Refactor TestStepContextExecutor
This commit is contained in:
parent
0f29955368
commit
19cb4b82ef
6 changed files with 73 additions and 17 deletions
25
act/runner/step_context_test.go
Normal file
25
act/runner/step_context_test.go
Normal file
|
@ -0,0 +1,25 @@
|
|||
package runner
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/nektos/act/pkg/common"
|
||||
)
|
||||
|
||||
func TestStepContextExecutor(t *testing.T) {
|
||||
platforms := map[string]string{
|
||||
"ubuntu-latest": "node:12.6-buster-slim",
|
||||
}
|
||||
tables := []TestJobFileInfo{
|
||||
{"testdata", "uses-github-empty", "push", "Expected format {org}/{repo}[/path]@ref", platforms},
|
||||
{"testdata", "uses-github-noref", "push", "Expected format {org}/{repo}[/path]@ref", platforms},
|
||||
{"testdata", "uses-github-root", "push", "", platforms},
|
||||
{"testdata", "uses-github-path", "push", "", platforms},
|
||||
}
|
||||
// These tests are sufficient to only check syntax.
|
||||
ctx := common.WithDryrun(context.Background(), true)
|
||||
for _, table := range tables {
|
||||
runTestJobFile(ctx, t, table)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue