|
14 | 14 | setup_pushapkscript: 'apt-get update && apt-get install -y default-jdk &&'
|
15 | 15 | setup_pushsnapscript: 'apt-get update && apt-get install -y libsodium-dev && truncate -s 0 /etc/os-release &&'
|
16 | 16 | setup_pushflatpakscript: 'apt-get update && apt-get install -y gir1.2-ostree-1.0 libgirepository1.0-dev &&'
|
| 17 | + setup_rust: 'rustup component add clippy rustfmt &&' |
17 | 18 | in:
|
18 | 19 | # [ <PROJECT NAME>, <PYTHON VERSION>, <SETUP COMMAND>, <DOCKERHUB REPO>]
|
19 | 20 | - ['client', '37', '', '']
|
|
45 | 46 | - ['treescript', '37', '', '']
|
46 | 47 | - ['treescript', '38', '', 'mozilla/releng-treescript']
|
47 | 48 | - ['pypiscript', '38', '', 'mozilla/releng-pypiscript']
|
| 49 | + - ['rust', 'rust', '${setup_rust}', ''] |
48 | 50 | # -------------------------------------------------------------------------
|
49 | 51 |
|
50 | 52 | HEAD_REV:
|
|
69 | 71 | $if: 'tasks_for == "github-push" && event.ref[0:11] == "refs/heads/"'
|
70 | 72 | then: '${event.ref[11:]}'
|
71 | 73 | else: 'unknown'
|
| 74 | + |
| 75 | + rust_version: 1.43 |
72 | 76 | in:
|
73 | 77 | $flatten:
|
74 | 78 | $map: { "$eval": "PROJECTS" }
|
@@ -116,7 +120,7 @@ tasks:
|
116 | 120 | in:
|
117 | 121 | $match:
|
118 | 122 | # Run code linting and unit tests for each project
|
119 |
| - 'run_tests == "1"': |
| 123 | + 'run_tests == "1" && project_name != "rust"': |
120 | 124 | taskId: '${as_slugid(project_name + python_version)}'
|
121 | 125 | provisionerId: 'releng-t'
|
122 | 126 | workerType: 'linux'
|
@@ -148,6 +152,37 @@ tasks:
|
148 | 152 | description: 'Code linting and unit tests for ${project_name} on python ${python_version[0]}.${python_version[1]}'
|
149 | 153 | owner: '${OWNER}'
|
150 | 154 | source: '${REPO_URL}/raw/${HEAD_REV}/.taskcluster.yml'
|
| 155 | + 'run_tests == "1" && project_name == "rust"': |
| 156 | + taskId: '${as_slugid("rust")}' |
| 157 | + provisionerId: 'releng-t' |
| 158 | + workerType: 'linux' |
| 159 | + created: { $fromNow: '' } |
| 160 | + deadline: { $fromNow: '4 hours' } |
| 161 | + payload: |
| 162 | + maxRunTime: 3600 |
| 163 | + image: 'rust:${rust_version}' |
| 164 | + command: |
| 165 | + - sh |
| 166 | + - -xce |
| 167 | + - >- |
| 168 | + cd /tmp && |
| 169 | + wget ${REPO_URL}/archive/${HEAD_REV}.tar.gz && |
| 170 | + tar zxf ${HEAD_REV}.tar.gz && |
| 171 | + mv scriptworker-scripts-${HEAD_REV} /src && |
| 172 | + cd /src && ${setup_command} |
| 173 | + cargo test && cargo clippy && cargo fmt --check |
| 174 | + metadata: |
| 175 | + name: |
| 176 | + $let: |
| 177 | + test_task_number: |
| 178 | + $if: 'dockerhub_repo != ""' |
| 179 | + then: '${i+1}.1' |
| 180 | + else: '${i+1}' |
| 181 | + in: |
| 182 | + '${number_prefix}${test_task_number}. ${project_name}: Run rust checks [on ${BRANCH_NAME}]' |
| 183 | + description: 'Code linting and unit tests for rust code on rust ${rust_version}' |
| 184 | + owner: '${OWNER}' |
| 185 | + source: '${REPO_URL}/raw/${HEAD_REV}/.taskcluster.yml' |
151 | 186 | # Build docker image and (optionally) push to docker hub
|
152 | 187 | 'run_tests == "1" && dockerhub_repo != ""':
|
153 | 188 | taskId: '${as_slugid(project_name + "docker_build_and_push")}'
|
|
0 commit comments