-
Notifications
You must be signed in to change notification settings - Fork 62
/
.taskcluster.yml
90 lines (90 loc) · 3.44 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
version: 1
policy:
pullRequests: public
tasks:
- $if: 'tasks_for == "github-push" || (tasks_for == "github-pull-request" && event["action"] in ["opened", "reopened", "synchronize"])'
then:
$let:
e: # FIXME after https://github.com/taskcluster/json-e/issues/249
$if: 'tasks_for == "github-push"'
then:
repo_name: ${event.repository.name}
repo_url: ${event.repository.url}
base_repo_url: ${event.repository.url}
login: ${event.pusher.name}
commit: ${event.after}
branch:
$if: 'event.ref[:11] == "refs/heads/"'
then: ${event.ref[11:]}
base_repo_name: ${event.repository.name}
base_login: ${event.repository.owner.name}
decision_id:
$if: 'event.ref[:10] == "refs/tags/"'
then: ${event.ref[10:]}
else: ${event.after}
else:
repo_name: ${event.pull_request.head.repo.name}
repo_url: ${event.pull_request.head.repo.clone_url}
base_repo_url: ${event.pull_request.base.repo.clone_url}
login: ${event.pull_request.head.user.login}
commit: ${event.pull_request.head.sha}
branch: ${event.pull_request.base.ref}
base_repo_name: ${event.pull_request.base.repo.name}
base_login: ${event.pull_request.base.repo.owner.login}
decision_id:
taskGroupId: {$eval: as_slugid("decision")}
in:
taskId: ${taskGroupId}
taskGroupId: ${taskGroupId}
schedulerId: taskcluster-github
provisionerId: proj-git-cinnabar
workerType: linux
retries: 5
scopes:
$flatten:
- assume:repo:github.com/${e.base_login}/${e.base_repo_name}:decision-task
- $if: 'tasks_for == "github-push"'
then:
- 'queue:route:index.project.git-cinnabar.*'
- secrets:get:project/git-cinnabar/codecov
routes:
$if: 'e.decision_id'
then:
- 'index.project.git-cinnabar.decision.${e.decision_id}'
payload:
maxRunTime: 3600
features:
taskclusterProxy: true
env:
TC_PROXY: "1"
TC_DATA: {$json: {$eval: e}}
TC_GROUP_ID: ${taskGroupId}
TC_IS_PUSH: {$if: 'tasks_for == "github-push"', then: "1"}
command:
- - sh
- '-c'
- >-
git clone -n ${e.base_repo_url} repo &&
git -C repo remote add head ${e.repo_url} &&
git -C repo remote update head &&
git -c advice.detachedHead=false -C repo checkout ${e.commit} &&
python3 -m venv venv &&
venv/bin/pip install pyyaml==6.0.1 requests==2.27.1 setuptools==70.3.0 &&
venv/bin/python3 repo/CI/decision.py
artifacts:
$if: 'e.decision_id'
then:
- name: public/actions.json
path: actions.json
type: file
created: {$fromNow: ''}
deadline: {$fromNow: '2 hours'}
expires:
$if: 'tasks_for == "action"'
then: {$fromNow: '6 hours'}
else: {$fromNow: '26 weeks'}
metadata:
name: decision task
description: ${e.repo_name} decision task
owner: ${e.login}@users.noreply.github.com
source: ${e.repo_url}