Skip to content

Commit fc11429

Browse files
ayusharmajuanpicado
authored andcommitted
chore: adds pull request action (conventional-changelog#37)
* chore: improvements in actions * chore: improvements in actions * chore: improvements in actions * chore: aggregates action in a script * chore: minor fix * chore: adds node 12 in action * chore: keep node 12 after 8 10 11 * chore: keep node 12 after 8 10 11 * chore: name fixes
1 parent 86bda48 commit fc11429

File tree

2 files changed

+69
-45
lines changed

2 files changed

+69
-45
lines changed

.github/main.workflow

+59-45
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,93 @@
1-
workflow "build and test" {
2-
resolves = [
3-
"lint",
4-
"test",
5-
"branch-filter",
1+
workflow "build & test" {
2+
resolves = [,
3+
"node:12"
64
]
7-
on = "push"
5+
on = "pull_request"
86
}
97

10-
action "branch-filter" {
8+
action "PR:filter" {
119
uses = "actions/bin/filter@master"
12-
args = "branch"
10+
args = "action 'opened|synchronize'"
1311
}
1412

15-
action "install" {
16-
uses = "docker://node:10"
17-
args = "yarn install"
13+
action "node:8" {
14+
needs = ["PR:filter"]
15+
uses = "docker://node:8"
16+
args = "sh scripts/build-test.sh"
1817
}
1918

20-
action "build" {
19+
action "node:10" {
20+
needs = ["PR:filter"]
2121
uses = "docker://node:10"
22-
needs = ["install"]
23-
args = "yarn run build"
22+
args = "sh scripts/build-test.sh"
2423
}
2524

26-
action "lint" {
27-
uses = "docker://node:10"
28-
needs = ["install"]
29-
args = "yarn run lint"
25+
action "node:11" {
26+
needs = ["PR:filter"]
27+
uses = "docker://node:11"
28+
args = "sh scripts/build-test.sh"
3029
}
3130

32-
action "test" {
33-
uses = "docker://node:10"
34-
needs = ["build"]
35-
args = "yarn run test"
31+
action "node:12" {
32+
needs = [
33+
"node:8",
34+
"node:10",
35+
"node:11"
36+
]
37+
uses = "docker://node:12"
38+
args = "sh scripts/build-test.sh"
3639
}
3740

38-
workflow "release" {
41+
workflow "build, test & release" {
3942
resolves = [
40-
"github-release",
41-
"release:lint",
43+
"github-release"
4244
]
4345
on = "push"
4446
}
4547

46-
action "release:tag-filter" {
47-
uses = "actions/bin/filter@master"
48-
args = "tag v*"
48+
action "push:node:8" {
49+
uses = "docker://node:8"
50+
args = "sh scripts/build-test.sh"
4951
}
5052

51-
action "release:install" {
53+
action "push:node:10" {
5254
uses = "docker://node:10"
53-
needs = ["release:tag-filter"]
54-
args = "yarn install"
55+
args = "sh scripts/build-test.sh"
5556
}
5657

57-
action "release:build" {
58-
uses = "docker://node:10"
59-
needs = ["release:install"]
60-
args = "yarn run build"
58+
action "push:node:11" {
59+
uses = "docker://node:11"
60+
args = "sh scripts/build-test.sh"
6161
}
6262

63-
action "release:lint" {
64-
uses = "docker://node:10"
65-
needs = ["release:install"]
66-
args = "yarn run lint"
63+
action "push:node:12" {
64+
needs = [
65+
"push:node:8",
66+
"push:node:10",
67+
"push:node:11",
68+
]
69+
uses = "docker://node:12"
70+
args = "sh scripts/build-test.sh"
6771
}
6872

69-
action "release:test" {
70-
uses = "docker://node:10"
71-
needs = ["release:build"]
72-
args = "yarn run test"
73+
action "release:filter" {
74+
needs = [
75+
"push:node:12"
76+
]
77+
uses = "actions/bin/filter@master"
78+
args = "tag v*"
79+
}
80+
81+
action "release:authorization" {
82+
needs = ["release:filter"]
83+
uses = "actions/bin/filter@master"
84+
args = ["actor", "ayusharma", "juanpicado"]
7385
}
7486

7587
action "release:publish" {
76-
needs = ["release:test"]
88+
needs = [
89+
"release:authorization"
90+
]
7791
uses = "docker://node:10"
7892
args = "sh scripts/publish.sh"
7993
secrets = [
@@ -91,4 +105,4 @@ action "github-release" {
91105
secrets = [
92106
"GITHUB_TOKEN",
93107
]
94-
}
108+
}

scripts/build-test.sh

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
yarn install
4+
5+
yarn run build
6+
7+
yarn run lint
8+
9+
yarn run test
10+

0 commit comments

Comments
 (0)