This repository has been archived by the owner on Jan 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
.drone.jsonnet
94 lines (88 loc) · 1.63 KB
/
.drone.jsonnet
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
local branches() = {
branch: [
"master",
],
};
local BuildInfo(version, limit_branches=false) = {
name: "build information",
image: "node:" + version,
commands: [
"node --version",
"npm --version",
],
[if limit_branches then "when"]: branches(),
};
local Install(version, limit_branches=false) = {
name: "install",
image: "node:" + version,
commands: [
"npm install",
],
[if limit_branches then "when"]: branches(),
};
local UnitTest(version) = {
kind: "pipeline",
name: "unit tests (node:" + version + ")",
steps: [
BuildInfo(version),
Install(version),
{
name: "unit tests",
image: "node:" + version,
commands: [
"npm run test",
],
},
],
};
local MeasureSizeAndTiming(version, limit_branches=false) = {
kind: "pipeline",
name: "size and timing (node:" + version + ")",
steps: [
{
name: "slow-deps",
image: "node:" + version,
commands: [
"npm install -g slow-deps",
"slow-deps"
],
[if limit_branches then "when"]: branches(),
},
],
};
[
{
kind: "pipeline",
name: "audit",
steps: [
BuildInfo("lts"),
Install("lts"),
{
name: "audit",
image: "node:lts",
commands: [
"npm audit",
],
},
],
},
{
kind: "pipeline",
name: "lint",
steps: [
BuildInfo("lts"),
Install("lts"),
{
name: "lint",
image: "node:lts",
commands: [
"npm run lint",
],
},
],
},
UnitTest("12"),
UnitTest("14"),
UnitTest("16"),
MeasureSizeAndTiming("lts"),
]