1
- workflow "build and test" {
1
+ # ###############################################
2
+ # Workflow for a branch push
3
+ # ###############################################
4
+ workflow "build and test on branch" {
2
5
resolves = [
3
- " lint" ,
4
- " test" ,
5
- " branch-filter" ,
6
+ " branch.lint.node.10" ,
7
+ " branch.test.node.10" ,
8
+ " branch.test.node.8" ,
9
+ # "branch.test.node.12"
6
10
]
7
11
on = " push"
8
12
}
9
13
10
- action "branch-filter" {
14
+ # node 10
15
+ action "branch.filter" {
11
16
uses = " actions/bin/filter@master"
12
17
args = " branch"
13
18
}
14
19
15
- action "install" {
20
+ action "branch.install.node.10" {
21
+ needs = [" branch.filter" ]
16
22
uses = " docker://node:10"
17
23
args = " yarn install"
18
24
}
19
25
20
- action "build" {
26
+ action "branch. build.node.10 " {
21
27
uses = " docker://node:10"
22
- needs = [" install" ]
28
+ needs = [" branch. install.node.10 " ]
23
29
args = " yarn run build"
24
30
}
25
31
26
- action "lint" {
32
+ action "branch. lint.node.10 " {
27
33
uses = " docker://node:10"
28
- needs = [" install" ]
34
+ needs = [" branch. install.node.10 " ]
29
35
args = " yarn run lint"
30
36
}
31
37
32
- action "test" {
38
+ action "branch. test.node.10 " {
33
39
uses = " docker://node:10"
34
- needs = [" build" ]
40
+ needs = [" branch. build.node.10 " ]
35
41
args = " yarn run test"
36
42
}
37
43
38
- workflow "release" {
44
+ # node 8
45
+ action "branch.install.node.8" {
46
+ needs = [" branch.filter" ]
47
+ uses = " docker://node:8"
48
+ args = " yarn install"
49
+ }
50
+
51
+ action "branch.build.node.8" {
52
+ uses = " docker://node:8"
53
+ needs = [" branch.install.node.8" ]
54
+ args = " yarn run build"
55
+ }
56
+
57
+ action "branch.test.node.8" {
58
+ uses = " docker://node:8"
59
+ needs = [" branch.build.node.8" ]
60
+ args = " yarn run test"
61
+ }
62
+
63
+ # @todo node 12
64
+ # action "branch.install.node.12" {
65
+ # needs = ["branch.filter"]
66
+ # uses = "docker://node:12"
67
+ # args = "yarn install"
68
+ # }
69
+
70
+ # action "branch.build.node.12" {
71
+ # uses = "docker://node:12"
72
+ # needs = ["branch.install.node.12"]
73
+ # args = "yarn run build"
74
+ # }
75
+
76
+ # action "branch.test.node.12" {
77
+ # uses = "docker://node:12"
78
+ # needs = ["branch.build.node.12"]
79
+ # args = "yarn run test"
80
+ # }
81
+
82
+ # ###############################################
83
+ # Workflow for a Pull request
84
+ # ###############################################
85
+ workflow "build and test on PR" {
39
86
resolves = [
40
- " github-release" ,
41
- " release:lint" ,
87
+ " pr.lint.node.10" ,
88
+ " pr.test.node.10" ,
89
+ " pr.test.node.8" ,
90
+ # "pr.test.node.12"
91
+ ]
92
+ on = " pull_request"
93
+ }
94
+
95
+ # node 10
96
+ action "pr.filter" {
97
+ uses = " actions/bin/filter@master"
98
+ args = " action 'opened|synchronize|reopened'"
99
+ }
100
+
101
+ action "pr.install.node.10" {
102
+ needs = [" pr.filter" ]
103
+ uses = " docker://node:10"
104
+ args = " yarn install"
105
+ }
106
+
107
+ action "pr.build.node.10" {
108
+ uses = " docker://node:10"
109
+ needs = [" pr.install.node.10" ]
110
+ args = " yarn run build"
111
+ }
112
+
113
+ action "pr.lint.node.10" {
114
+ uses = " docker://node:10"
115
+ needs = [" pr.install.node.10" ]
116
+ args = " yarn run lint"
117
+ }
118
+
119
+ action "pr.test.node.10" {
120
+ uses = " docker://node:10"
121
+ needs = [" pr.build.node.10" ]
122
+ args = " yarn run test"
123
+ }
124
+
125
+ # node 8
126
+ action "pr.install.node.8" {
127
+ needs = [" pr.filter" ]
128
+ uses = " docker://node:8"
129
+ args = " yarn install"
130
+ }
131
+
132
+ action "pr.build.node.8" {
133
+ uses = " docker://node:8"
134
+ needs = [" pr.install.node.8" ]
135
+ args = " yarn run build"
136
+ }
137
+
138
+ action "pr.test.node.8" {
139
+ uses = " docker://node:8"
140
+ needs = [" pr.build.node.8" ]
141
+ args = " yarn run test"
142
+ }
143
+
144
+ # @todo node 12
145
+ # action "pr.install.node.12" {
146
+ # needs = ["pr.filter"]
147
+ # uses = "docker://node:12"
148
+ # args = "yarn install"
149
+ # }
150
+
151
+ # action "pr.build.node.12" {
152
+ # uses = "docker://node:12"
153
+ # needs = ["pr.install.node.12"]
154
+ # args = "yarn run build"
155
+ # }
156
+
157
+ # action "pr.test.node.12" {
158
+ # uses = "docker://node:12"
159
+ # needs = ["pr.build.node.12"]
160
+ # args = "yarn run test"
161
+ # }
162
+
163
+
164
+ # ###############################################
165
+ # Workflow for a github release when a tag is
166
+ # pushed
167
+ # ###############################################
168
+ workflow "github release" {
169
+ resolves = [
170
+ " release.github" ,
171
+ " release.lint" ,
42
172
]
43
173
on = " push"
44
174
}
45
175
46
- action "release:tag- filter" {
176
+ action "release. filter" {
47
177
uses = " actions/bin/filter@master"
48
178
args = " tag v*"
49
179
}
50
180
51
- action "release: install" {
181
+ action "release. install" {
52
182
uses = " docker://node:10"
53
- needs = [" release:tag- filter" ]
183
+ needs = [" release. filter" ]
54
184
args = " yarn install"
55
185
}
56
186
57
- action "release: build" {
187
+ action "release. build" {
58
188
uses = " docker://node:10"
59
- needs = [" release: install" ]
189
+ needs = [" release. install" ]
60
190
args = " yarn run build"
61
191
}
62
192
63
- action "release: lint" {
193
+ action "release. lint" {
64
194
uses = " docker://node:10"
65
- needs = [" release: install" ]
195
+ needs = [" release. install" ]
66
196
args = " yarn run lint"
67
197
}
68
198
69
- action "release: test" {
199
+ action "release. test" {
70
200
uses = " docker://node:10"
71
- needs = [" release: build" ]
201
+ needs = [" release. build" ]
72
202
args = " yarn run test"
73
203
}
74
204
75
- action "release:publish" {
76
- needs = [" release:test" ]
205
+ action "release.auth" {
206
+ needs = [" release.test" ]
207
+ uses = " actions/bin/filter@master"
208
+ args = [" actor" , " octocat" , " torvalds" ]
209
+ }
210
+
211
+ action "release.npm.publish" {
212
+ needs = [" release.auth" ]
77
213
uses = " docker://node:10"
78
214
args = " sh scripts/publish.sh"
79
215
secrets = [
@@ -84,8 +220,8 @@ action "release:publish" {
84
220
}
85
221
}
86
222
87
- action "github- release" {
88
- needs = [" release: publish" ]
223
+ action "release.github " {
224
+ needs = [" release.npm. publish" ]
89
225
uses = " docker://node:10"
90
226
args = " sh scripts/github-release.sh"
91
227
secrets = [
0 commit comments