Skip to content

Commit 1070e5c

Browse files
ayusharmajuanpicado
authored andcommitted
chore: adds actions (conventional-changelog#40)
* chore: adds actions * chore: updates workflow * chore: leave node 12 placeholder * chore: leave node 12 placeholder
1 parent 11f5091 commit 1070e5c

File tree

1 file changed

+164
-28
lines changed

1 file changed

+164
-28
lines changed

.github/main.workflow

+164-28
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,215 @@
1-
workflow "build and test" {
1+
################################################
2+
# Workflow for a branch push
3+
################################################
4+
workflow "build and test on branch" {
25
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"
610
]
711
on = "push"
812
}
913

10-
action "branch-filter" {
14+
# node 10
15+
action "branch.filter" {
1116
uses = "actions/bin/filter@master"
1217
args = "branch"
1318
}
1419

15-
action "install" {
20+
action "branch.install.node.10" {
21+
needs = ["branch.filter"]
1622
uses = "docker://node:10"
1723
args = "yarn install"
1824
}
1925

20-
action "build" {
26+
action "branch.build.node.10" {
2127
uses = "docker://node:10"
22-
needs = ["install"]
28+
needs = ["branch.install.node.10"]
2329
args = "yarn run build"
2430
}
2531

26-
action "lint" {
32+
action "branch.lint.node.10" {
2733
uses = "docker://node:10"
28-
needs = ["install"]
34+
needs = ["branch.install.node.10"]
2935
args = "yarn run lint"
3036
}
3137

32-
action "test" {
38+
action "branch.test.node.10" {
3339
uses = "docker://node:10"
34-
needs = ["build"]
40+
needs = ["branch.build.node.10"]
3541
args = "yarn run test"
3642
}
3743

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" {
3986
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",
42172
]
43173
on = "push"
44174
}
45175

46-
action "release:tag-filter" {
176+
action "release.filter" {
47177
uses = "actions/bin/filter@master"
48178
args = "tag v*"
49179
}
50180

51-
action "release:install" {
181+
action "release.install" {
52182
uses = "docker://node:10"
53-
needs = ["release:tag-filter"]
183+
needs = ["release.filter"]
54184
args = "yarn install"
55185
}
56186

57-
action "release:build" {
187+
action "release.build" {
58188
uses = "docker://node:10"
59-
needs = ["release:install"]
189+
needs = ["release.install"]
60190
args = "yarn run build"
61191
}
62192

63-
action "release:lint" {
193+
action "release.lint" {
64194
uses = "docker://node:10"
65-
needs = ["release:install"]
195+
needs = ["release.install"]
66196
args = "yarn run lint"
67197
}
68198

69-
action "release:test" {
199+
action "release.test" {
70200
uses = "docker://node:10"
71-
needs = ["release:build"]
201+
needs = ["release.build"]
72202
args = "yarn run test"
73203
}
74204

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"]
77213
uses = "docker://node:10"
78214
args = "sh scripts/publish.sh"
79215
secrets = [
@@ -84,8 +220,8 @@ action "release:publish" {
84220
}
85221
}
86222

87-
action "github-release" {
88-
needs = ["release:publish"]
223+
action "release.github" {
224+
needs = ["release.npm.publish"]
89225
uses = "docker://node:10"
90226
args = "sh scripts/github-release.sh"
91227
secrets = [

0 commit comments

Comments
 (0)