-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.star
39 lines (34 loc) · 972 Bytes
/
.drone.star
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
NODE_SUPPORTED_VERSIONS = (14, 16, 18)
NODE_IMAGE_TEMPLATE = "node:{major}-slim"
def install_deps(image):
return {
"name": "install-deps",
"image": image,
"pull": "always",
"commands": [
"yarn install --immutable",
],
}
def test(major_version):
image = NODE_IMAGE_TEMPLATE.format(major=major_version)
return {
"kind": "pipeline",
"name": "test-node{major}".format(major=major_version),
"steps": [
install_deps(image),
{
"name": "test",
"image": image,
"commands": [
"yarn run test",
"yarn run build",
],
},
],
}
def main(ctx):
pipelines = []
if ctx.build.event in ("push", "pull_request"):
for major_version in NODE_SUPPORTED_VERSIONS:
pipelines.append(test(major_version))
return pipelines