github.com/joomcode/cue@v0.4.4-0.20221111115225-539fe3512047/tools/flow/testdata/template.txtar (about) 1 #InferTasks: true 2 -- in.cue -- 3 import "tool/exec" 4 5 foo: { 6 $id: "tool/http.Do" 7 8 method: "GET" 9 url: string 10 11 request: body: *bytes | string 12 } 13 14 // vendorgithubschema is expected to be run within the github.com/joomcode/cue 15 // cue.mod directory 16 root: { 17 get: foo & { 18 request: body: "" 19 url: "https://raw.githubusercontent.com/SchemaStore/schemastore/f7a0789ccb3bd74a720ddbd6691d60fd9e2d8b7a/src/schemas/json/github-workflow.json" 20 } 21 convert: exec.Run & { 22 stdin: get.response.body 23 cmd: "go run github.com/joomcode/cue/cmd/cue import -f -p json -l #Workflow: jsonschema: - --outfile pkg/github.com/SchemaStore/schemastore/src/schemas/json/github-workflow.cue" 24 } 25 } 26 -- out/run/errors -- 27 -- out/run/t0 -- 28 graph TD 29 t0("root.get [Ready]") 30 t1("root.convert [Waiting]") 31 t1-->t0 32 33 -- out/run/t1 -- 34 graph TD 35 t0("root.get [Terminated]") 36 t1("root.convert [Ready]") 37 t1-->t0 38 39 -- out/run/t1/value -- 40 { 41 $id: "tool/http.Do" 42 method: "GET" 43 stdout: "foo" 44 url: "https://raw.githubusercontent.com/SchemaStore/schemastore/f7a0789ccb3bd74a720ddbd6691d60fd9e2d8b7a/src/schemas/json/github-workflow.json" 45 request: { 46 body: "" 47 } 48 } 49 -- out/run/t2 -- 50 graph TD 51 t0("root.get [Terminated]") 52 t1("root.convert [Terminated]") 53 t1-->t0 54 55 -- out/run/t2/value -- 56 { 57 $id: "tool/exec.Run" 58 cmd: "go run github.com/joomcode/cue/cmd/cue import -f -p json -l #Workflow: jsonschema: - --outfile pkg/github.com/SchemaStore/schemastore/src/schemas/json/github-workflow.cue" 59 env: {} 60 stdout: "foo" 61 stderr: null 62 stdin: (*null | string | bytes) & get.response.body 63 success: bool 64 } 65 -- out/run/t3 -- 66 graph TD 67 t0("root.get [Terminated]") 68 t0-->t2 69 t1("root.convert [Terminated]") 70 t1-->t0 71 t2("foo [Terminated]") 72 73 -- out/run/t3/value -- 74 { 75 $id: "tool/exec.Run" 76 cmd: "go run github.com/joomcode/cue/cmd/cue import -f -p json -l #Workflow: jsonschema: - --outfile pkg/github.com/SchemaStore/schemastore/src/schemas/json/github-workflow.cue" 77 env: {} 78 stdout: "foo" 79 stderr: null 80 stdin: (*null | string | bytes) & get.response.body 81 success: bool 82 }