-
Notifications
You must be signed in to change notification settings - Fork 15
/
.taskcluster.yml
149 lines (141 loc) · 4.67 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
version: 1
policy:
pullRequests: public
tasks:
$let:
head_branch:
$if: 'tasks_for == "github-pull-request"'
then: ${event.pull_request.head.ref}
else:
$if: 'tasks_for == "github-push"'
then: ${event.ref}
else: ${event.release.target_commitish}
head_rev:
$if: 'tasks_for == "github-pull-request"'
then: ${event.pull_request.head.sha}
else:
$if: 'tasks_for == "github-push"'
then: ${event.after}
else: ${event.release.tag_name}
repository:
$if: 'tasks_for == "github-pull-request"'
then: ${event.pull_request.head.repo.html_url}
else: ${event.repository.html_url}
channel:
$if: 'tasks_for == "github-push"'
then:
$if: 'event.ref in ["refs/heads/testing", "refs/heads/production"]'
then: ${event.ref[11:]}
else: 'dev'
else: 'dev'
tag:
$if: 'tasks_for == "github-push"'
then:
$if: 'event.ref[:10] == "refs/tags/"'
then: {$eval: 'event.ref[10:]' }
else: "latest"
else: "latest"
taskboot_image: "mozilla/taskboot:0.2.2"
in:
- taskId: {$eval: as_slugid("check_lint")}
provisionerId: proj-relman
workerType: ci
created: {$fromNow: ''}
deadline: {$fromNow: '1 hour'}
payload:
maxRunTime: 3600
image: python:3.10
command:
- sh
- -lxce
- "git clone --quiet ${repository} /src && cd /src && git checkout ${head_rev} -b checks &&
pip install -q . && pip install -q -r requirements-dev.txt &&
cd /src && pre-commit run -a --show-diff-on-failure"
metadata:
name: "libmozevent checks: linting"
description: Check code style with pre-commit hooks
owner: bastien@mozilla.com
source: https://github.com/mozilla/libmozevent
- taskId: {$eval: as_slugid("check_tests")}
provisionerId: proj-relman
workerType: ci
created: {$fromNow: ''}
deadline: {$fromNow: '1 hour'}
payload:
maxRunTime: 3600
image: python:3.10
command:
- sh
- -lxce
- "apt-get -qq update &&
apt-get -qq install -y redis-server &&
git clone --quiet ${repository} /src && cd /src && git checkout ${head_rev} -b checks &&
pip install -q . && pip install -q -r requirements-dev.txt &&
/src/docker/bootstrap.sh &&
pytest -v &&
export REDIS_URL='redis://localhost:6379/' &&
redis-server --daemonize yes &&
pytest -v"
metadata:
name: "libmozevent checks: unit tests"
description: Check python code with pytest
owner: bastien@mozilla.com
source: https://github.com/mozilla/libmozevent
- $if: 'tag != "latest"'
then:
taskId: {$eval: as_slugid("publish")}
created: {$fromNow: ''}
deadline: {$fromNow: '1 hour'}
provisionerId: proj-relman
workerType: ci
dependencies:
- {$eval: as_slugid("check_lint")}
- {$eval: as_slugid("check_tests")}
payload:
features:
taskclusterProxy: true
maxRunTime: 3600
image: "${taskboot_image}"
env:
TASKCLUSTER_SECRET: "project/relman/libmozevent/deploy"
GIT_REPOSITORY: "${repository}"
GIT_REVISION: "${head_rev}"
command:
- taskboot
- deploy-pypi
scopes:
- "secrets:get:project/relman/libmozevent/deploy"
metadata:
name: "libmozevent publication on PyPi"
description: Publish new version on PyPi
owner: bastien@mozilla.com
source: https://github.com/mozilla/libmozevent
- $if: 'tag != "latest"'
then:
taskId: {$eval: as_slugid("release")}
created: {$fromNow: ''}
deadline: {$fromNow: '1 hour'}
provisionerId: proj-relman
workerType: ci
dependencies:
- {$eval: as_slugid("check_lint")}
- {$eval: as_slugid("check_tests")}
payload:
features:
taskclusterProxy: true
maxRunTime: 3600
image: "${taskboot_image}"
env:
TASKCLUSTER_SECRET: "project/relman/libmozevent/deploy"
command:
- taskboot
- github-release
- mozilla/libmozevent
- "${tag}"
scopes:
- "secrets:get:project/relman/libmozevent/deploy"
metadata:
name: "libmozevent publication on GitHub"
description: Publish release notes on GitHub
owner: bastien@mozilla.com
source: https://github.com/mozilla/libmozevent