forked from taskcluster/taskcluster
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.taskcluster.yml
297 lines (295 loc) · 11.5 KB
/
.taskcluster.yml
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
version: 1
reporting: checks-v1
policy:
pullRequests: public
tasks:
$if: 'tasks_for in ["github-push", "github-pull-request"]'
then:
$let:
node: '12.13.0'
go: '1.12.9'
artifactsDir:
public:
# This is not used at the moment other than by the trailer task to upload results. Feel free to bump later
expires: {$fromNow: '24 hours'}
path: /taskcluster/artifacts
type: directory
in:
$let:
debug:
$if: 'tasks_for == "github-push"'
then:
$if: 'event.head_commit.message[:7] == "DEBUG: "'
then: ${event.head_commit.message[7:]}
else: ''
else: ''
owner: [email protected]
# This only supports pushes and pull requests for now.
# If we start responding to another action type, make this
# a $match.
repo:
$if: 'tasks_for == "github-push"'
then:
git_url: ${event.repository.url}
url: ${event.repository.url}
ref: ${event.after}
branch: ${event.ref}
else:
git_url: ${event.pull_request.head.repo.git_url}
url: ${event.pull_request.head.repo.url}
ref: ${event.pull_request.head.sha}
branch: ${event.pull_request.head.ref}
# We keep the separate from "others" so that we can assert a 1-1 mapping onto existing packages
packages:
- name: taskcluster-lib-api
- name: taskcluster-lib-app
- name: taskcluster-lib-azure
- name: taskcluster-lib-iterate
- name: taskcluster-lib-loader
- name: taskcluster-lib-monitor
- name: taskcluster-lib-pulse
image: taskcluster/rabbit-test:${node}
env:
PULSE_CONNECTION_STRING: amqp://guest:guest@localhost:5672/
command: >-
service rabbitmq-server start &&
yarn workspace taskcluster-lib-pulse coverage:report
artifacts: {$eval: artifactsDir}
- name: taskcluster-lib-references
- name: taskcluster-lib-scopes
- name: taskcluster-lib-testing
- name: taskcluster-lib-config
- name: taskcluster-lib-validate
- name: taskcluster-auth
- name: taskcluster-built-in-workers
- name: taskcluster-github
- name: taskcluster-hooks
- name: taskcluster-index
- name: taskcluster-notify
- name: taskcluster-purge-cache
- name: taskcluster-queue
- name: taskcluster-worker-manager
- name: taskcluster-secrets
- name: taskcluster-web-server
others:
- name: lint
command: yarn lint
- name: test:meta
command: yarn test:meta
# only do cleanup on pushes; no sense doing so on pull requests
- $if: 'tasks_for == "github-push" && event["ref"] == "refs/heads/master"'
then:
name: test:cleanup
command: yarn test:cleanup
- name: yarn generate
image: taskcluster/node-and-go:node${node}-go${go}
command: >-
set -o pipefail &&
yarn generate | cat &&
if ! output=$(git status --porcelain) || [ -n "$output" ]; then
echo "*** yarn generate produced changes to the repository; these changes should be checked in ***";
git --no-pager diff;
exit 1;
fi
- name: yarn build
command: yarn build --dry-run
- name: yarn changelog
command:
$if: 'tasks_for == "github-pull-request"'
then: yarn changelog:check --pr ${event.number}
else: yarn changelog:check
- name: taskcluster-client
# taskcluster-client tests use taskcluster-lib-*, including taskcluster-lib-testing,
# and thus require a full install at the monorepo root (including devDependencies)
install: >-
{ yarn --frozen-lockfile || exit 99; } &&
cd clients/client &&
{ yarn --frozen-lockfile || exit 99; }
command: >-
yarn test &&
yarn package-test
- name: taskcluster-client-web
image: 'taskcluster/browser-test:${node}'
install: >-
{ yarn --frozen-lockfile || exit 99; } &&
cd clients/client-web &&
{ yarn --frozen-lockfile || exit 99; }
command: >-
{ Xvfb :99 -screen 0 640x480x8 -nolisten tcp & } &&
sleep 2 &&
CHROME_BIN=firefox DISPLAY=:99 yarn test
- name: taskcluster-client-py-2.7
image: 'python:2.7'
cache: {taskcluster-test-pip-cache: /cache}
install: >-
cd clients/client-py &&
virtualenv /sandbox &&
/sandbox/bin/pip install tox
command: >-
TOXENV=py27 /sandbox/bin/tox
- name: taskcluster-client-py-3.6
image: 'python:3.6'
cache: {taskcluster-test-pip-cache: /cache}
install: >-
cd clients/client-py &&
python3 -mvenv /sandbox &&
/sandbox/bin/pip install tox
command: >-
TOXENV=py36 /sandbox/bin/tox
- name: taskcluster-client-py-3.7
image: 'python:3.7'
cache: {taskcluster-test-pip-cache: /cache}
install: >-
cd clients/client-py &&
python3 -mvenv /sandbox &&
/sandbox/bin/pip install tox
command: >-
TOXENV=py37 /sandbox/bin/tox
- name: taskcluster-client-go-${go}
image: 'golang:${go}'
install: >-
cd clients/client-go
command: >-
go test -v -race ./...
- name: taskcluster-client-shell-${go}
image: 'golang:${go}'
install: >-
cd clients/client-shell
command: >-
go test -v -race ./...
- name: check for invalid go pseudo-versions
# see https://github.com/taskcluster/taskcluster/issues/1492
image: 'golang:1.13.1'
install: ":"
command: >-
(cd clients/client-go && go list -m all) &&
(cd clients/client-shell && go list -m all)
- name: taskcluster-ui
image: 'taskcluster/browser-test:${node}'
install: >-
{ yarn --frozen-lockfile || exit 99; } &&
cd ui &&
{ yarn --frozen-lockfile || exit 99; }
command: >-
yarn lint &&
{ Xvfb :99 -screen 0 640x480x8 -nolisten tcp & } &&
sleep 2 &&
CHROME_BIN=firefox DISPLAY=:99 yarn test
- name: upload-coverage
command: >-
yarn fetch-coverage &&
bash <(curl -s https://codecov.io/bash) -b $TASK_ID/$RUN_ID
post_packages: true
in:
$let:
allTasks:
$map:
$map:
$flatten:
- $map: {$eval: packages}
each(p):
$merge:
- {$eval: p}
- {artifacts: {$eval: artifactsDir}}
- $eval: others
each(entry):
name: ${entry.name}
image: # use `image` if given, falling back to the node image
$if: entry['image']
then: ${entry.image}
else: "node:${node}"
command: # use `command` if given, falling back to basic yarn test
$if: entry['command']
then: ${entry.command}
else: >-
yarn workspace ${entry.name} coverage:report
env: # add in any custom env vars that this package needs
$if: entry['env']
then: {$eval: entry.env}
else: {}
install:
$if: entry['install']
then: ${entry.install}
else: >-
{ yarn --frozen-lockfile || exit 99; } &&
eval "$(yarn -s shared-secrets)"
cache:
$if: entry['cache']
then: {$eval: entry.cache}
else: {taskcluster-test-yarn-cache: /cache}
dependencies:
$if: entry['post_packages']
then:
$map: {$eval: packages}
each(p): {$eval: as_slugid(p.name)}
else: []
artifacts:
$if: entry['artifacts']
then: {$eval: entry.artifacts}
else: {}
each(job):
taskId: {$eval: as_slugid(job.name)}
provisionerId: proj-taskcluster
workerType: ci
created: {$fromNow: ''}
deadline: {$fromNow: '3 hours'}
dependencies: {$eval: job.dependencies}
extra:
notify:
email:
subject: 'Failed: $${task.metadata.name} on taskcluster/taskcluster master'
routes:
$if: 'tasks_for == "github-push" && event["ref"] == "refs/heads/master"'
then:
- notify.email.${owner}.on-failed
- notify.email.${owner}.on-exception
- notify.irc-channel.#taskcluster-bots.on-any
scopes:
- secrets:get:project/taskcluster/testing/azure
- secrets:get:project/taskcluster/testing/codecov
- secrets:get:project/taskcluster/testing/taskcluster-*
- docker-worker:cache:taskcluster-test-*
payload:
artifacts: {$eval: job.artifacts}
features:
taskclusterProxy: true
env:
$merge:
- DEBUG: ${debug}
CODECOV_NAME: ${job.name}
CI_BUILD_URL: 'https://tools.taskcluster.net/tasks/${as_slugid(job.name)}'
GIT_BRANCH: ${repo.branch}
NO_TEST_SKIP:
$if: 'job.name != "taskcluster-lib-testing"'
then: true
YARN_CACHE_FOLDER: /cache
XDG_CACHE_HOME: /cache
- {$eval: job.env}
maxRunTime: 1200
onExitStatus:
# the `yarn --frozen-lockfile` invocation will exit with this status if it fails,
# in which case we want to retry (assuming it's some upstream issue)
retry: [99]
cache: {$eval: job.cache}
image: ${job.image}
command:
- "/bin/bash"
- "-c"
- >-
git clone --quiet --depth=20 --no-single-branch ${repo.git_url} taskcluster &&
cd taskcluster &&
git checkout ${repo.ref} &&
${job.install} &&
${job.command}
metadata:
name: ${job.name}
description: ${job.name}
owner: ${owner}
source: ${repo.url}
in:
$flattenDeep:
# only build pushes to master; everything else should be tested in a PR
- $if: 'tasks_for == "github-push" && event["ref"] == "refs/heads/master"'
then: {$eval: allTasks}
- $if: 'tasks_for == "github-pull-request" && event["action"] in ["opened", "reopened", "synchronize"]'
then: {$eval: allTasks}