mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-09-30 19:22:09 +00:00
the license change from MIT to GPLv3+ is a breaking change Refs forgejo/runner#773 <!--start release-notes-assistant--> <!--URL:https://code.forgejo.org/forgejo/runner--> - other - [PR](https://code.forgejo.org/forgejo/runner/pulls/940): <!--number 940 --><!--line 0 --><!--description Y2hvcmU6IGJ1bXAgdmVyc2lvbiB0byB2MTE=-->chore: bump version to v11<!--description--> <!--end release-notes-assistant--> Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/940 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
515 B
Go
25 lines
515 B
Go
package jobparser
|
|
|
|
import (
|
|
"bytes"
|
|
"embed"
|
|
"path/filepath"
|
|
"testing"
|
|
|
|
"code.forgejo.org/forgejo/runner/v11/act/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
|
|
}
|