mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-08-06 17:40:58 +00:00
- the model defines them as strings and can parse them either as string or their effective type (boolean, number) - add workflow validation when reading all testdata - add fail-fast, max-parallel, timeout-minutes, cancel-timeout-minutes to test workflows in the jobparser tests Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/203 Reviewed-by: Michael Kriese <michael.kriese@gmx.de> Co-authored-by: Earl Warren <contact@earl-warren.org> Co-committed-by: Earl Warren <contact@earl-warren.org>
25 lines
501 B
Go
25 lines
501 B
Go
package jobparser
|
|
|
|
import (
|
|
"bytes"
|
|
"embed"
|
|
"path/filepath"
|
|
"testing"
|
|
|
|
"github.com/nektos/act/pkg/model"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
//go:embed testdata
|
|
var testdata embed.FS
|
|
|
|
func ReadTestdata(t *testing.T, name string) []byte {
|
|
t.Helper()
|
|
filename := filepath.Join("testdata", name)
|
|
content, err := testdata.ReadFile(filename)
|
|
require.NoError(t, err, filename)
|
|
_, err = model.ReadWorkflow(bytes.NewReader(content), true)
|
|
require.NoError(t, err, filename)
|
|
return content
|
|
}
|