-
Notifications
You must be signed in to change notification settings - Fork 51
/
Copy path.taskcluster.yml
126 lines (121 loc) · 4.62 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
version: 1
policy:
pullRequests: public
tasks:
$let:
user: ${event.sender.login}
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}
in:
$if: 'tasks_for in ["github-pull-request", "github-push"]'
then:
- taskId: {$eval: as_slugid("lint_test_task")}
created: {$fromNow: ''}
deadline: {$fromNow: '1 hour'}
provisionerId: proj-relman
workerType: ci
payload:
maxRunTime: 3600
image: "rust:buster"
command:
- "/bin/bash"
- "-cx"
- "curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && python3 get-pip.py &&
rustup toolchain install stable &&
rustup toolchain install nightly &&
rustup default stable &&
rustup component add clippy &&
rustup component add rustfmt &&
git clone --recursive --quiet ${repository} &&
cd rust-code-analysis &&
git -c advice.detachedHead=false checkout ${head_rev} &&
pip3 install --quiet pre-commit &&
pre-commit run -a &&
rustup default nightly &&
cargo test"
metadata:
name: rust-code-analysis lint and test
description: rust-code-analysis lint and test
owner: [email protected]
source: ${repository}/raw/${head_rev}/.taskcluster.yml
- $if: 'tasks_for == "github-push" && head_branch[:10] == "refs/tags/"'
then:
taskId: {$eval: as_slugid("build_release")}
dependencies:
- {$eval: as_slugid("lint_test_task")}
created: {$fromNow: ''}
deadline: {$fromNow: '2 hour'}
provisionerId: proj-relman
workerType: ci
payload:
maxRunTime: 3600
image: "rust:buster"
env:
PROJECT_NAME: rust-code-analysis
command:
- "/bin/bash"
- "-cx"
- "git clone --recursive --quiet ${repository} &&
cd rust-code-analysis &&
git -c advice.detachedHead=false checkout ${head_rev} &&
cargo build --release &&
cd target/release &&
tar -zvcf /build.tar.gz --transform 's,^,rust-code-analysis-linux-x86_64/,' rust-code-analysis"
artifacts:
public/rust-code-analysis-linux-x86_64.tar.gz:
expires: {$fromNow: '2 weeks'}
path: /build.tar.gz
type: file
metadata:
name: rust-code-analysis release build
description: rust-code-analysis release build
owner: [email protected]
source: ${repository}/raw/${head_rev}/.taskcluster.yml
- $if: 'tasks_for == "github-push" && head_branch[:10] == "refs/tags/"'
then:
$let:
version: {$eval: 'head_branch[10:]'}
in:
taskId: {$eval: as_slugid("deploy_release")}
dependencies:
- {$eval: as_slugid("build_release")}
created: {$fromNow: ''}
deadline: {$fromNow: '2 hour'}
provisionerId: proj-relman
workerType: ci
scopes:
- secrets:get:project/relman/rust-code-analysis/deploy
payload:
features:
taskclusterProxy: true
maxRunTime: 3600
image: "mozilla/taskboot:0.2.0"
env:
TASKCLUSTER_SECRET: project/relman/rust-code-analysis/deploy
command:
- taskboot
- github-release
- mozilla/rust-code-analysis
- "${version}"
- "--asset=rust-code-analysis-linux-x86_64.tar.gz:public/rust-code-analysis-linux-x86_64.tar.gz"
metadata:
name: "rust-code-analysis release publication ${version}"
description: rust-code-analysis release publication on Github
owner: [email protected]
source: ${repository}/raw/${head_rev}/.taskcluster.yml