-
Notifications
You must be signed in to change notification settings - Fork 3.9k
/
Copy pathchecks.js
120 lines (99 loc) · 3.48 KB
/
checks.js
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
'use strict';
/**
* @fileoverview Script that runs various checks during CI.
*/
const {runCiJob} = require('./ci-job');
const {Targets, buildTargetsInclude} = require('./build-targets');
const {timedExecOrDie} = require('./utils');
const jobName = 'checks.js';
/**
* Steps to run during push builds.
*/
function pushBuildWorkflow() {
timedExecOrDie('amp presubmit');
timedExecOrDie('amp check-invalid-whitespaces');
timedExecOrDie('amp validate-html-fixtures');
timedExecOrDie('amp lint');
timedExecOrDie('amp prettify');
timedExecOrDie('amp ava');
timedExecOrDie('amp check-build-system');
timedExecOrDie('amp babel-plugin-tests');
timedExecOrDie('amp caches-json');
timedExecOrDie('amp check-exact-versions');
timedExecOrDie('amp check-renovate-config');
timedExecOrDie('amp server-tests');
timedExecOrDie('amp make-extension --name=t --test --cleanup');
timedExecOrDie('amp make-extension --name=t --test --cleanup --bento');
timedExecOrDie('amp dep-check');
timedExecOrDie('amp check-types');
timedExecOrDie('amp check-sourcemaps');
timedExecOrDie('amp performance-urls');
timedExecOrDie('amp check-analytics-vendors-list');
timedExecOrDie('amp check-video-interface-list');
timedExecOrDie('amp get-zindex');
timedExecOrDie('amp markdown-toc');
}
/**
* Steps to run during PR builds.
*/
function prBuildWorkflow() {
if (buildTargetsInclude(Targets.PRESUBMIT)) {
timedExecOrDie('amp presubmit');
}
if (buildTargetsInclude(Targets.INVALID_WHITESPACES)) {
timedExecOrDie('amp check-invalid-whitespaces');
}
if (buildTargetsInclude(Targets.HTML_FIXTURES)) {
timedExecOrDie('amp validate-html-fixtures');
}
if (buildTargetsInclude(Targets.LINT_RULES)) {
timedExecOrDie('amp lint');
} else if (buildTargetsInclude(Targets.LINT)) {
timedExecOrDie('amp lint --local_changes');
}
if (buildTargetsInclude(Targets.PRETTIFY)) {
timedExecOrDie('amp prettify');
}
if (buildTargetsInclude(Targets.AVA)) {
timedExecOrDie('amp ava');
}
if (buildTargetsInclude(Targets.BUILD_SYSTEM)) {
timedExecOrDie('amp check-build-system');
}
if (buildTargetsInclude(Targets.BABEL_PLUGIN)) {
timedExecOrDie('amp babel-plugin-tests');
}
if (buildTargetsInclude(Targets.CACHES_JSON)) {
timedExecOrDie('amp caches-json');
}
if (buildTargetsInclude(Targets.DOCS)) {
timedExecOrDie('amp check-links --local_changes'); // only for PR builds
timedExecOrDie('amp markdown-toc');
}
if (buildTargetsInclude(Targets.OWNERS)) {
timedExecOrDie('amp check-owners --local_changes'); // only for PR builds
}
if (buildTargetsInclude(Targets.PACKAGE_UPGRADE)) {
timedExecOrDie('amp check-exact-versions');
}
if (buildTargetsInclude(Targets.RENOVATE_CONFIG)) {
timedExecOrDie('amp check-renovate-config');
}
if (buildTargetsInclude(Targets.SERVER)) {
timedExecOrDie('amp server-tests');
}
if (buildTargetsInclude(Targets.AVA, Targets.RUNTIME)) {
timedExecOrDie('amp make-extension --name=t --test --cleanup');
timedExecOrDie('amp make-extension --name=t --test --cleanup --bento');
}
if (buildTargetsInclude(Targets.RUNTIME)) {
timedExecOrDie('amp dep-check');
timedExecOrDie('amp check-types');
timedExecOrDie('amp check-sourcemaps');
timedExecOrDie('amp performance-urls');
timedExecOrDie('amp check-analytics-vendors-list');
timedExecOrDie('amp check-video-interface-list');
timedExecOrDie('amp get-zindex');
}
}
runCiJob(jobName, pushBuildWorkflow, prBuildWorkflow);