-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtasks.yaml
168 lines (143 loc) · 2.7 KB
/
tasks.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
# The package from where to fetch the actions files
actions: task_executor.actions
tasks:
#### Vanilla tasks
task1:
steps:
- op: assign
params:
var_name: output_value
expr: 3
var:
- output_value
- loop: trigger_thrice
params:
condition: var.output_value
loop_body:
task: task1_loop
params:
input_value: var.output_value
var:
- output_value
- action: wait
params:
duration: 5.0
- action: set_string
params:
string_data: "and now we bow..."
task1_loop:
params:
- input_value
var:
- output_value
steps:
- action: trigger
var:
- success
- action: integers
params:
input_value: params.input_value
var:
- output_value
#### Choice tests
choice_test:
params:
- param1
- param2
var:
- var1
steps:
- choice: choice1
params:
condition: "(params.param1 is None and params.param2 is not None)"
if_true:
op: assign
params:
var_name: var1
expr: 1
var:
- var1
if_false:
op: assign
params:
var_name: var1
expr: 2
var:
- var1
- choice: choice2
params:
condition: params.param1 == 1
if_true:
op: assign
params:
var_name: var1
expr: 3
var:
- var1
#### Loop tests
loop_test:
params:
- num_iterations
steps:
- op: assign
params:
var_name: cond
expr: 0
var:
- cond
- loop: loop
params:
condition: var.cond < params.num_iterations
loop_body:
task: loop_body_test
params:
cond: var.cond
var:
- cond
loop_body_test:
params:
- cond
var:
- cond
steps:
- action: trigger
var:
- success
- op: increment
params:
var_name: cond
expr: params.cond + 1
var:
- cond
#### Op tests
index_into_container:
params:
- container
- idx
var:
- entity
steps:
- op: index
params:
var_name: entity
expr: params.container[params.idx]
var:
- entity
fibonacci:
params:
- n
var:
- value
steps:
- op: assign
params:
var_name: fib
expr: "lambda x,y=[1,1]:([(y.append(y[-1]+y[-2]),y[-1])[1] for i in range(1+x-len(y))],y[x])[1]"
var:
- fib
- op: assign
params:
var_name: value
expr: var.fib(params.n)
var:
- value