2021-01-23 10:07:28 -06:00
package runner
import (
"context"
"testing"
"github.com/nektos/act/pkg/common"
)
func TestStepContextExecutor ( t * testing . T ) {
platforms := map [ string ] string {
2021-06-10 18:12:05 -05:00
"ubuntu-latest" : baseImage ,
2021-01-23 10:07:28 -06:00
}
tables := [ ] TestJobFileInfo {
2021-05-02 10:15:13 -05:00
{ "testdata" , "uses-and-run-in-one-step" , "push" , "Invalid run/uses syntax for job:test step:Test" , platforms , "" } ,
{ "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 , "" } ,
2021-05-07 22:29:03 -05:00
{ "testdata" , "uses-docker-url" , "push" , "" , platforms , "" } ,
{ "testdata" , "uses-github-full-sha" , "push" , "" , platforms , "" } ,
{ "testdata" , "uses-github-short-sha" , "push" , "Unable to resolve action `actions/hello-world-docker-action@b136eb8`, the provided ref `b136eb8` is the shortened version of a commit SHA, which is not supported. Please use the full commit SHA `b136eb8894c5cb1dd5807da824be97ccdf9b5423` instead" , platforms , "" } ,
2021-01-23 10:07:28 -06:00
}
// These tests are sufficient to only check syntax.
ctx := common . WithDryrun ( context . Background ( ) , true )
for _ , table := range tables {
2021-05-10 10:12:57 -05:00
runTestJobFile ( ctx , t , table )
2021-01-23 10:07:28 -06:00
}
}