mirror of
https://gitea.com/gitea/act_runner
synced 2026-09-21 19:37:07 +02:00
fix(deps): update to actionslib v1.0.0 (#1221)
Updates `gitea.dev/actionslib` to v1.0.0, see https://gitea.com/gitea/actionslib/pulls/17: 1. First-party expression parser passing GitHub's full conformance suite, replacing actionlint 1. Expression results match GitHub, including truthiness, numbers, `fromJSON`, `toJSON` and `hashFiles` cache keys 1. Whole-value `${{ }}` works for `strategy`, `env`, `with`, `services` and `outputs` 1. Matrix validation matches GitHub --------- Co-authored-by: bircni <bircni@icloud.com> Reviewed-on: https://gitea.com/gitea/runner/pulls/1221 Reviewed-by: bircni <bircni@icloud.com> Co-authored-by: silverwind <me@silverwind.io>
This commit is contained in:
committed by
bircni
co-authored by
bircni
parent
e0ce6776c7
commit
3d116eb0c2
@@ -372,6 +372,19 @@ jobs:
|
||||
require.Empty(t, redis.WorkingDir)
|
||||
}
|
||||
|
||||
// A whole-value `services:` expression only reaches the typed field through DecodeRaw.
|
||||
func TestStartJobContainerGivesServicesTheirVolumesFromExpression(t *testing.T) {
|
||||
redis := startJobContainerInputs(t, `
|
||||
jobs:
|
||||
job:
|
||||
services: ${{ fromJSON('{"redis":{"image":"redis:latest","volumes":["data:/data"]}}') }}
|
||||
`, &Config{ValidVolumes: []string{"data"}})[0]
|
||||
|
||||
require.Equal(t, "redis:latest", redis.Image)
|
||||
require.Equal(t, []string{"data"}, redis.ValidVolumes)
|
||||
require.Equal(t, map[string]string{"data": "/data"}, redis.Mounts)
|
||||
}
|
||||
|
||||
// Only the workflow's options may be stripped later, so the two sources have to reach the
|
||||
// container apart from each other.
|
||||
func TestStartJobContainerKeepsRunnerOptionsApartFromWorkflowOptions(t *testing.T) {
|
||||
@@ -827,6 +840,20 @@ func TestInterpolateOutputsIsPerMatrixCombo(t *testing.T) {
|
||||
require.Equal(t, "b", job.Outputs["o"])
|
||||
}
|
||||
|
||||
// A whole-value `outputs:` expression only reaches the typed field through DecodeRaw.
|
||||
func TestInterpolateOutputsFromExpression(t *testing.T) {
|
||||
var rawOutputs yaml.Node
|
||||
require.NoError(t, rawOutputs.Encode(`${{ fromJSON('{"o":"resolved"}') }}`))
|
||||
|
||||
job := &model.Job{RawOutputs: rawOutputs}
|
||||
run := &model.Run{JobID: "j", Workflow: &model.Workflow{Name: "w", Jobs: map[string]*model.Job{"j": job}}}
|
||||
rc, err := (&runnerImpl{config: &Config{}}).newRunContext(t.Context(), run, nil)
|
||||
require.NoError(t, err)
|
||||
|
||||
require.NoError(t, rc.interpolateOutputs()(t.Context()))
|
||||
require.Equal(t, "resolved", job.Outputs["o"])
|
||||
}
|
||||
|
||||
func TestGetGitHubContext(t *testing.T) {
|
||||
log.SetLevel(log.DebugLevel)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user