1
0
Fork 0
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:
KADOTA, Kyohei 2021-01-24 01:07:28 +09:00 committed by GitHub
parent 0f29955368
commit 19cb4b82ef
6 changed files with 73 additions and 17 deletions

View 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)
}
}