|
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', '', ''] |
|
44 | 45 | - ['signingscript', '38', '', 'mozilla/releng-signingscript'] |
45 | 46 | - ['treescript', '37', '', ''] |
46 | 47 | - ['treescript', '38', '', 'mozilla/releng-treescript'] |
| 48 | + - ['rust', 'rust', '${setup_rust}', ''] |
47 | 49 | # ------------------------------------------------------------------------- |
48 | 50 |
|
49 | 51 | HEAD_REV: |
|
68 | 70 | $if: 'tasks_for == "github-push" && event.ref[0:11] == "refs/heads/"' |
69 | 71 | then: '${event.ref[11:]}' |
70 | 72 | else: 'unknown' |
| 73 | + |
| 74 | + rust_version: 1.43 |
71 | 75 | in: |
72 | 76 | $flatten: |
73 | 77 | $map: { "$eval": "PROJECTS" } |
@@ -115,7 +119,7 @@ tasks: |
115 | 119 | in: |
116 | 120 | $match: |
117 | 121 | # Run code linting and unit tests for each project |
118 | | - 'run_tests == "1"': |
| 122 | + 'run_tests == "1" && project_name != "rust"': |
119 | 123 | taskId: '${as_slugid(project_name + python_version)}' |
120 | 124 | provisionerId: 'releng-t' |
121 | 125 | workerType: 'linux' |
@@ -147,6 +151,37 @@ tasks: |
147 | 151 | description: 'Code linting and unit tests for ${project_name} on python ${python_version[0]}.${python_version[1]}' |
148 | 152 | owner: '${OWNER}' |
149 | 153 | source: '${REPO_URL}/raw/${HEAD_REV}/.taskcluster.yml' |
| 154 | + 'run_tests == "1" && project_name == "rust"': |
| 155 | + taskId: '${as_slugid("rust")}' |
| 156 | + provisionerId: 'releng-t' |
| 157 | + workerType: 'linux' |
| 158 | + created: { $fromNow: '' } |
| 159 | + deadline: { $fromNow: '4 hours' } |
| 160 | + payload: |
| 161 | + maxRunTime: 3600 |
| 162 | + image: 'rust:${rust_version}' |
| 163 | + command: |
| 164 | + - sh |
| 165 | + - -xce |
| 166 | + - >- |
| 167 | + cd /tmp && |
| 168 | + wget ${REPO_URL}/archive/${HEAD_REV}.tar.gz && |
| 169 | + tar zxf ${HEAD_REV}.tar.gz && |
| 170 | + mv scriptworker-scripts-${HEAD_REV} /src && |
| 171 | + cd /src && ${setup_command} |
| 172 | + cargo test && cargo clippy && cargo fmt -- --check |
| 173 | + metadata: |
| 174 | + name: |
| 175 | + $let: |
| 176 | + test_task_number: |
| 177 | + $if: 'dockerhub_repo != ""' |
| 178 | + then: '${i+1}.1' |
| 179 | + else: '${i+1}' |
| 180 | + in: |
| 181 | + '${number_prefix}${test_task_number}. ${project_name}: Run rust checks [on ${BRANCH_NAME}]' |
| 182 | + description: 'Code linting and unit tests for rust code on rust ${rust_version}' |
| 183 | + owner: '${OWNER}' |
| 184 | + source: '${REPO_URL}/raw/${HEAD_REV}/.taskcluster.yml' |
150 | 185 | # Build docker image and (optionally) push to docker hub |
151 | 186 | 'run_tests == "1" && dockerhub_repo != ""': |
152 | 187 | taskId: '${as_slugid(project_name + "docker_build_and_push")}' |
|
0 commit comments